Skip to content

Commit

Permalink
Fix stack-use-after-scope on Windows in Precompute (WebAssembly#6643)
Browse files Browse the repository at this point in the history
Create a temp var to store the ChildIterator.

Fixes WebAssembly#6639
  • Loading branch information
mtb0x1 authored and radekdoulik committed Jul 12, 2024
1 parent 0f83bf4 commit 1c7cda9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/passes/Precompute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,8 @@ struct Precompute
}

auto* child = stack[index];
for (auto** currChild : ChildIterator(stack[index - 1]).children) {
auto childIterator = ChildIterator(stack[index - 1]);
for (auto** currChild : childIterator.children) {
if (*currChild == child) {
return currChild;
}
Expand Down

0 comments on commit 1c7cda9

Please sign in to comment.