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

Incorrect codegen in arithmetic expressions in REPLs #50

Open
xTrayambak opened this issue Dec 6, 2024 · 0 comments
Open

Incorrect codegen in arithmetic expressions in REPLs #50

xTrayambak opened this issue Dec 6, 2024 · 0 comments
Assignees
Labels
codegen bug A bug in the IR emitter

Comments

@xTrayambak
Copy link
Member

Sample

let x = 3
console.log(x) // Log: 3
let y = x + 5
console.log(y) // Log: null
console.log(x) // Log: null

The value at x is magically reduced to atoms (no pun intended). This is because the IR generator incorrectly generates a MOVE opcode when it should really emit COPY instead. We could implement the current behaviour as a heuristical optimization later.

@xTrayambak xTrayambak added the codegen bug A bug in the IR emitter label Dec 6, 2024
@xTrayambak xTrayambak self-assigned this Dec 6, 2024
@xTrayambak xTrayambak changed the title Incorrect codegen in arithmetic expressions Incorrect codegen in arithmetic expressions in REPLs Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen bug A bug in the IR emitter
Projects
None yet
Development

No branches or pull requests

1 participant