diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-validator.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h index ac8cac410..b9ad30c73 100644 --- a/src/wasm-validator.h +++ b/src/wasm-validator.h @@ -126,8 +126,10 @@ public: } } void visitSetLocal(SetLocal *curr) { + shouldBeTrue(curr->index < getFunction()->getNumLocals(), curr, "set_local index must be small enough"); if (curr->value->type != unreachable) { shouldBeEqualOrFirstIsUnreachable(curr->value->type, curr->type, curr, "set_local type must be correct"); + shouldBeEqual(getFunction()->getLocalType(curr->index), curr->value->type, curr, "set_local type must match function"); } } void visitLoad(Load *curr) { |