Skip to content

Fix wantarray void context in eval STRING#234

Closed
fglock wants to merge 1 commit into
masterfrom
fix-eval-wantarray-context
Closed

Fix wantarray void context in eval STRING#234
fglock wants to merge 1 commit into
masterfrom
fix-eval-wantarray-context

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented Feb 25, 2026

EvalStringHandler.evalString() was hardcoding RuntimeContextType.SCALAR when executing the eval body, so wantarray() inside eval STRING always returned false (scalar) regardless of the actual call site context.\n\nFix: read registers[2] (the outer wantarray set by BytecodeInterpreter) and pass it as callContext to evalString() and apply(), so wantarray() inside the eval body correctly returns undef (void), false (scalar), or true (list) matching the outer call site.\n\nResult: op/eval.t passes 153/153 in both JVM and interpreter modes.

@fglock
Copy link
Copy Markdown
Owner Author

fglock commented Feb 25, 2026

Superseded — the wantarray fix is included in PR #233 which has been merged into master.

@fglock fglock closed this Feb 25, 2026
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