Skip to content

Commit 1c7cda9

Browse files
mtb0x1radekdoulik
authored andcommitted
Fix stack-use-after-scope on Windows in Precompute (WebAssembly#6643)
Create a temp var to store the ChildIterator. Fixes WebAssembly#6639
1 parent 0f83bf4 commit 1c7cda9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/passes/Precompute.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,8 @@ struct Precompute
829829
}
830830

831831
auto* child = stack[index];
832-
for (auto** currChild : ChildIterator(stack[index - 1]).children) {
832+
auto childIterator = ChildIterator(stack[index - 1]);
833+
for (auto** currChild : childIterator.children) {
833834
if (*currChild == child) {
834835
return currChild;
835836
}

0 commit comments

Comments
 (0)