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

Time-of-check-time-of-use issue with synthetic label generation in fake LVT generation #675

Open
Earthcomputer opened this issue Jul 22, 2024 · 0 comments

Comments

@Earthcomputer
Copy link

While investigating #674, I found another issue with the synthetic label generation. When getting a local variable at an instruction, the instruction is converted to an index in the InsnList here. Then, synthetic labels can be added to facilitate the fake LVT generation, which may change the index of the original instruction. This causes this check to potentially produce incorrect results.

I don't have a repro case right now, but it's easy to see how this could cause problems and the fix should be simple so I reported it anyway. If I were to construct a repro case, I would look for code where the LVT covers some local variables but not others, such as the synthetic Iterator variables in enhanced for loops. The variables in the LVT would not trigger fake LVT generation, but when LVT generation does happen they could generate synthetic labels which come before the Iterator variable causing a mismatch in the instruction index in the latter's ASTORE.

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

No branches or pull requests

1 participant