Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate doesn't correctly handle assignments to locals #55423

Open
rmacnak-google opened this issue Apr 10, 2024 · 1 comment
Open

Evaluate doesn't correctly handle assignments to locals #55423

rmacnak-google opened this issue Apr 10, 2024 · 1 comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. P3 A lower priority bug or feature request triaged Issue has been triaged by sub team vm-debugger vm-service The VM Service Protocol, both the specification and its implementation

Comments

@rmacnak-google
Copy link
Contributor

Pulling a more specific problem out of #23446,

main() {
   var x = 1;
   debugger();  // evaluate `x++`, continue
   print(x);
}

This should print 2, but currently will print 1. The current compilation strategy for evaluate is roughly to create a new closure function (var x) => x++, which fails to write back to frame we're evaluating in. Squeak Smalltalk and Newspeak instead do something like (var context) => context[0] = context[0] + 1), where context is the reified activation record and x was allocated to slot 0, which makes the evaluation have the expected effect.

@rmacnak-google rmacnak-google added area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. vm-debugger area-front-end Use area-front-end for front end / CFE / kernel format related issues. vm-service The VM Service Protocol, both the specification and its implementation labels Apr 10, 2024
@a-siva a-siva added P3 A lower priority bug or feature request triaged Issue has been triaged by sub team labels Apr 10, 2024
@a-siva
Copy link
Contributor

a-siva commented Apr 10, 2024

//cc @derekxu16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. P3 A lower priority bug or feature request triaged Issue has been triaged by sub team vm-debugger vm-service The VM Service Protocol, both the specification and its implementation
Projects
None yet
Development

No branches or pull requests

2 participants