Skip to content

Fix test utility call checks in DSLX bytecode interpreter. - #4683

Draft
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_956043364
Draft

Fix test utility call checks in DSLX bytecode interpreter.#4683
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_956043364

Conversation

@copybara-service

Copy link
Copy Markdown

Fix test utility call checks in DSLX bytecode interpreter.

Update BytecodeEmitter to associate the enclosing function (source_fn) with bytecode generated for expressions by traversing up the AST parent chain.

Update BytecodeInterpreter to walk up the stack frames to find the caller function when checking if a test utility function is called from a test context. This ensures that helper calls nested inside expressions (e.g., in array size expressions) are correctly identified as coming from the enclosing function.

Expand the test context check to allow calls from #[test] functions, #[cfg(test)] functions, and #[test_proc] configurations.

Update `BytecodeEmitter` to associate the enclosing function (`source_fn`) with bytecode generated for expressions by traversing up the AST parent chain.

Update `BytecodeInterpreter` to walk up the stack frames to find the caller function when checking if a test utility function is called from a test context. This ensures that helper calls nested inside expressions (e.g., in array size expressions) are correctly identified as coming from the enclosing function.

Expand the test context check to allow calls from `#[test]` functions, `#[cfg(test)]` functions, and `#[test_proc]` configurations.

PiperOrigin-RevId: 956043364
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