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 Jun 5, 2024
1 parent ea4d9e4 commit 76d1ac3
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 @@ -858,7 +858,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 76d1ac3

Please sign in to comment.