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

Use the pcRel macro to compute the current pc. #95

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

ltratt
Copy link
Contributor

@ltratt ltratt commented Nov 1, 2024

The line of code in this commit was off-by-one, though in a way that didn't undermine the correctness of yk per se, since we were always off-by-one. However, it would have meant that we wrote to the word immediately past the end of an allocation, which is UB.

The cause of this is the vmfetch macro, executed before the line of code changed by this commit which increments pc: thus by the time we execute the line of code in this commit, pc no longer points to the actual pc we wanted, but one after it. The pcRel macro does the necessary magic (i.e. subtracting 1) to resolve this.

The line of code in this commit was off-by-one, though in a way that
didn't undermine the correctness of yk per se, since we were always
off-by-one. However, it would have meant that we wrote to the word
immediately past the end of an allocation, which is UB.

The cause of this is the `vmfetch` macro, executed before the line of
code changed by this commit which increments `pc`: thus by the time we
execute the line of code in this commit, `pc` no longer points to the
actual `pc` we wanted, but one after it. The `pcRel` macro does the
necessary magic (i.e. subtracting 1) to resolve this.
@vext01 vext01 added this pull request to the merge queue Nov 1, 2024
Merged via the queue into ykjit:main with commit 3bad330 Nov 1, 2024
2 checks passed
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.

2 participants