Skip to content

Fix lifetime confusion in shadow stack pass #2596

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

Merged
merged 2 commits into from
Dec 22, 2022
Merged

Fix lifetime confusion in shadow stack pass #2596

merged 2 commits into from
Dec 22, 2022

Conversation

dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Dec 22, 2022

Potential fix for the errors observed in #2594, and prior in #2575.

let outer = null;
while (condition) {
  let inner = value;
  outer = inner; // here
}

Previously, at // here, no shadow stack slot was populated, assuming that inner respectively value is already kept alive by another slot. In a loop, this assumption doesn't hold obviously, since if inner is reassigned a different value in a subsequent iteration, the previous value copied to outer is, due to skipping the stack slot, no longer kept alive.

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@dcodeIO dcodeIO mentioned this pull request Dec 22, 2022
2 tasks
@dcodeIO dcodeIO requested a review from CountBleck December 22, 2022 19:01
Copy link
Member

@CountBleck CountBleck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. It would be nice if slots could still be omitted by checking lifetimes somehow.

@dcodeIO dcodeIO merged commit d3410f4 into main Dec 22, 2022
@HerrCai0907 HerrCai0907 deleted the actuallyNeedsSlot branch October 17, 2023 09:00
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