Skip to content

Read a meta without arguments as having none in the closure pass - #43

Open
Tutez64 wants to merge 1 commit into
MeguminBOT:mainfrom
Tutez64:bugfix/cppia-meta-without-args
Open

Tutez64 wants to merge 1 commit into
MeguminBOT:mainfrom
Tutez64:bugfix/cppia-meta-without-args

Conversation

@Tutez64

@Tutez64 Tutez64 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

A meta written without parentheses ends the whole compile batch:

return @:privateAccess new Holder().secret(); // or @:privateAccess host.field

parseMetaArgs answers null rather than [] when there are no parentheses, and Capture's two walkers (mapChildren and rewrite) iterate the argument list unchecked. The Null Object Reference is not an Unsupported, so it leaves Backend.compile and takes every module of the batch with it, not just the one carrying the meta; in a host compiling several mods in one world, all of them. Interpreted, the same code runs. ExprTools already guards this (args == null ? null : ...); Capture now does the same.

Two corpus cases, a script's private method and a host field, both behind @:privateAccess. Without the change both are killed on hxcpp-cppia; with it eval-interp, hxcpp-interp, hxcpp-cppia and hxcpp-cppia-jit answer 42 and 0, and every other row is unchanged. test/run.sh eval cpp: 421 / 421 / 453 passed. The sandbox builds against flixel 6.2.0, flixel-addons 4.0.1 and flixel-ui 2.6.5, and its four projects probe the same as before (--probe, JIT on and off). HashLink not run.

🤖 Generated with Claude Code

A meta written without parentheses, such as @:privateAccess, carries a null argument list, which Capture walked unchecked. The null ended the whole compile batch rather than the module holding the meta. ExprTools already guarded it the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant