diff options
author | mtb <39337159+mtb0x1@users.noreply.github.com> | 2024-06-05 02:14:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-05 00:14:50 +0000 |
commit | 76d1ac3e9c5abfe589bcdfc84b89f263bac7c574 (patch) | |
tree | 1a9926b7be714c4f90454e9d8ca4525f66d61dcb | |
parent | ea4d9e45e1b9a929a38fbca9a6c316b0b918b12e (diff) | |
download | binaryen-76d1ac3e9c5abfe589bcdfc84b89f263bac7c574.tar.gz binaryen-76d1ac3e9c5abfe589bcdfc84b89f263bac7c574.tar.bz2 binaryen-76d1ac3e9c5abfe589bcdfc84b89f263bac7c574.zip |
Fix stack-use-after-scope on Windows in Precompute (#6643)
Create a temp var to store the ChildIterator.
Fixes #6639
-rw-r--r-- | src/passes/Precompute.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp index 295d86b40..ba04a68aa 100644 --- a/src/passes/Precompute.cpp +++ b/src/passes/Precompute.cpp @@ -858,7 +858,8 @@ private: } 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; } |