File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed
Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -1361,8 +1361,13 @@ template<typename Subtype> struct ChildTyper : OverriddenVisitor<Subtype> {
13611361 void visitStructWait (StructWait* curr,
13621362 std::optional<HeapType> ht = std::nullopt ) {
13631363 if (!ht) {
1364+ if (!curr->structType .isStruct ()) {
1365+ self ().noteUnknown ();
1366+ return ;
1367+ }
13641368 ht = curr->structType ;
13651369 }
1370+
13661371 note (&curr->ref , Type (*ht, Nullable));
13671372 note (&curr->expected , Type (Type::BasicType::i32 ));
13681373 note (&curr->timeout , Type (Type::BasicType::i64 ));
Original file line number Diff line number Diff line change @@ -1165,13 +1165,19 @@ class EffectAnalyzer {
11651165 parent.mayNotReturn = true ;
11661166 parent.implicitTrap = true ;
11671167
1168- // if (curr->)
1168+ if (curr->ref ->type == Type::unreachable) {
1169+ return ;
1170+ }
11691171
1170- // field must exist and be a packed waitqueue if this is valid Wasm.
1171- if (curr->structType .isStruct () &&
1172- curr->index < curr->structType .getStruct ().fields .size () &&
1173- curr->structType .getStruct ().fields .at (curr->index ).mutable_ ==
1174- Mutable) {
1172+ // If the ref isn't `unreachable`, then the field must exist and be a
1173+ // packed waitqueue due to validation.
1174+ if (curr->ref ->type .isStruct () &&
1175+ curr->index <
1176+ curr->ref ->type .getHeapType ().getStruct ().fields .size () &&
1177+ curr->ref ->type .getHeapType ()
1178+ .getStruct ()
1179+ .fields .at (curr->index )
1180+ .mutable_ == Mutable) {
11751181 parent.readsMutableStruct = true ;
11761182 }
11771183 }
You can’t perform that action at this time.
0 commit comments