diff options
author | Alon Zakai <azakai@google.com> | 2022-05-25 10:09:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 17:09:57 +0000 |
commit | 808be8a27f7adf00f2410219507b649cdab4aa99 (patch) | |
tree | 504dc7d13929ad22137e7716043afdb4331e7599 /src/cfg/cfg-traversal.h | |
parent | 3542bd9429529bfd9fbe6a85f8f97a9388ef3c2a (diff) | |
download | binaryen-808be8a27f7adf00f2410219507b649cdab4aa99.tar.gz binaryen-808be8a27f7adf00f2410219507b649cdab4aa99.tar.bz2 binaryen-808be8a27f7adf00f2410219507b649cdab4aa99.zip |
[Wasm GC] Fix CFG traversal of call_ref and add missing validation check (#4690)
We were missing CallRef in the CFG traversal code in a place where we
note possible exceptions. As a result we thought CallRef cannot throw, and
were missing some control flow edges.
To actually detect the problem, we need to validate non-nullable locals
properly, which we were not doing. This adds that as well.
Diffstat (limited to 'src/cfg/cfg-traversal.h')
-rw-r--r-- | src/cfg/cfg-traversal.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cfg/cfg-traversal.h b/src/cfg/cfg-traversal.h index faaa3c830..478b4780e 100644 --- a/src/cfg/cfg-traversal.h +++ b/src/cfg/cfg-traversal.h @@ -392,7 +392,8 @@ struct CFGWalker : public ControlFlowWalker<SubType, VisitorType> { break; } case Expression::Id::CallId: - case Expression::Id::CallIndirectId: { + case Expression::Id::CallIndirectId: + case Expression::Id::CallRefId: { self->pushTask(SubType::doEndCall, currp); break; } |