Fix Role::Basic nested eval runtime context#686
Merged
Conversation
Replace eval STRING runtime context storage with a per-thread stack so nested eval compilation cannot overwrite the outer context. Track temporary BEGIN-package aliases and hide them while require/do compilation runs, preventing reentrant role loads from reusing the outer lexical $role scalar. Add a neutral regression test for the Role::Basic-shaped nested eval/use path and update the Role::Basic module notes with verification. Verification: - make - timeout 60 ./jperl src/test/resources/unit/eval_context_stack_reentrancy.t - timeout 600 ./jcpan -t Role::Basic Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <codex@openai.com>
Hide eval BEGIN aliases only while compiling required/do files, not while executing BEGIN wrappers. BEGIN blocks inside eval STRING need those aliases to mutate captured outer lexicals. Add regression coverage for the BEGIN alias path exposed by op/grep.t. Verification: - make - timeout 60 ./jperl src/test/resources/unit/eval_context_stack_reentrancy.t - timeout 120 ../../jperl op/attrs.t - timeout 120 ../../jperl op/grep.t - timeout 120 ../../jperl op/magic.t - timeout 180 ../../jperl op/eval.t - timeout 600 ./jcpan -t Role::Basic Generated with [Codex](https://openai.com/codex) Co-Authored-By: Codex <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
maketimeout 60 ./jperl src/test/resources/unit/eval_context_stack_reentrancy.ttimeout 600 ./jcpan -t Role::BasicGenerated with Codex