Commit 40403f43

40403f434501Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 1 file · ~1 modified

Description

Merge pull request #288 from ryanseys/rs-node-missing

feat(parse): support MissingNode (parse-error placeholder; defensive handler)

Details

Commit
40403f434501
Parent
2fbb4325ac48
Merge parent
203c72c77fc2

spinel_parse.cmodifiedView file

@@ -794,6 +794,16 @@
794794 node_counter--;
795795 return flatten(n->value);
796796 }
797+ case PM_MISSING_NODE: {
798+ /* Prism emits MissingNode as an error-recovery placeholder. main()
799+ bails out before flatten() runs when parser.error_list is
800+ non-empty, so reaching this case means Prism produced a
801+ MissingNode without flagging an error -- a contract violation we
802+ surface clearly rather than silently miscompile. */
803+ fprintf(stderr, "spinel_parse: internal error: MissingNode reached flatten() at byte offset %td; parse error not in error_list\n",
804+ node->location.start - g_parser->start);
805+ exit(1);
806+ }
797807 case PM_SPLAT_NODE: {
798808 pm_splat_node_t *n = (pm_splat_node_t *)node;
799809 N("SplatNode");