step-examples/12-1c-syntax/Ls018.stp
Sources
- T019, A018
Description
Trailing extra `;` confuses parsers expecting another `#` definition or `ENDSEC`. Second `;` may be tokenized as start of an empty entity, leading to NULL entity-class lookup.
Reproducer recipe
`#20=IFCPROJECT('xyz',#5,'',$,$,$,$,(#11),#19);;`
Expected kernel behavior
Reject by default; lenient mode silently drop empty statements with `W_EMPTY_STATEMENT` diagnostic; never construct an empty/NULL entity.
Notes
Cross-oracle: pure-Python Part-21 validator rejects (reject(E_UNRESOLVED_REFS)); OCCT silently accepts (load is `empty`). OCC auto-heals a spec-level violation. Synonyms: "double semicolon after STEP instance", "STEP file has ;;", "extra semicolon between entities", "empty entity from double semicolon", "trailing semicolon after instance".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
contains(b';;')count(b';;') >= 2
Tier-3 assertions
load == "ok"
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1/* Ls018 - Two consecutive semicolons (;;) after instance 2 ---------------------------------------------------------------------- 3 Catalog section : §12.1c punctuation 4 Sources : T019, A018 5 Originally also catalogued as: Ad018 6 ---------------------------------------------------------------------- 7 Defect 8 A trailing extra ';' confuses parsers expecting another '#' definition 9 or an 'ENDSEC' keyword. The second ';' may be tokenized as the start 10 of an empty entity, leading to a NULL entity-class lookup and later 11 null-deref or garbage type-id dispatch. 12 Expected behavior 13 Strict mode: reject with "unexpected ';' at top level". 14 Lenient mode: silently drop empty statements with W_EMPTY_STATEMENT 15 diagnostic; never construct an empty / NULL entity. 16 ---------------------------------------------------------------------- 17*/ 18ISO-10303-21; 19HEADER; 20FILE_DESCRIPTION(('Ls018 - double semicolon after instance'),'2;1'); 21FILE_NAME('Ls018.stp','2026-04-26T00:00:00',('auto-generated'),(''), 22 'auto-generated','',''); 23FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 24ENDSEC; 25DATA; 26#10=CARTESIAN_POINT('p',(0.0,0.0,0.0)); 27#11=DIRECTION('x',(1.0,0.0,0.0)); 28/* Defect: two consecutive semicolons after the instance terminator */ 29#20=IFCPROJECT('xyz',#5,'',$,$,$,$,(#11),#10);; 30/* Defect: triple semicolon */ 31#21=DIRECTION('y',(0.0,1.0,0.0));;; 32#30=AXIS2_PLACEMENT_3D('placement',#10,#11,$); 33ENDSEC; 34END-ISO-10303-21;