Skip to content

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