Skip to content

Fix postfix deref eval/interpreter regressions and JVM ->%[]#238

Merged
fglock merged 2 commits into
masterfrom
fix-interpreter-postfixderef-op-postfixderef
Feb 26, 2026
Merged

Fix postfix deref eval/interpreter regressions and JVM ->%[]#238
fglock merged 2 commits into
masterfrom
fix-interpreter-postfixderef-op-postfixderef

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented Feb 25, 2026

Summary

Fixes several postfix dereference regressions.

  • JVM: implement correct index/value slice semantics for ->%[...] (returns alternating index/value pairs).
  • Eval-string interpreter: allow glob lvalue assignment where the LHS is an expression (*EXPR = ..., e.g. "mysubalias"->** = ...) by compiling the glob expression and emitting STORE_GLOB.
  • Runtime: fix PVIO postfix glob deref (->** on *STDOUT{IO}) by creating a temporary glob when the scalar holds a RuntimeIO (handles both GLOB and GLOBREFERENCE representations), preventing ClassCastException.
  • Interpreter disassembly: keep disassembly in sync for DEREF_HASH and guard string pool lookups.
  • Parser/compiler: add/compile postfix key/value slices (->%{...} / ->%[...]) and interpreter opcode for hash key/value slices.

Repro

  • JVM ->%[...]:
    • perl5_t/t/op/postfixderef.t line 317
  • Eval-string interpreter path:
    • JPERL_EVAL_USE_INTERPRETER=1 perl5_t/t/op/postfixderef.t

Notes

This PR is a checkpoint; remaining eval-string interpreter differences are still being worked on (e.g. tests 70-71, 36, and postderef_qq interpolation cases under JPERL_EVAL_USE_INTERPRETER=1).

@fglock fglock merged commit 606eb27 into master Feb 26, 2026
2 checks passed
@fglock fglock deleted the fix-interpreter-postfixderef-op-postfixderef branch February 26, 2026 08:41
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