summaryrefslogtreecommitdiff
path: root/src/validator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/validator.cc')
-rw-r--r--src/validator.cc17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/validator.cc b/src/validator.cc
index 00c97d9d..8a3d4940 100644
--- a/src/validator.cc
+++ b/src/validator.cc
@@ -864,7 +864,7 @@ Result Validator::OnThrowExpr(ThrowExpr* expr) {
expr_loc_ = &expr->loc;
const Event* event;
if (Succeeded(CheckEventVar(&expr->var, &event))) {
- typechecker_.OnThrow(event->sig);
+ typechecker_.OnThrow(event->decl.sig.param_types);
}
return Result::Ok;
}
@@ -1343,18 +1343,9 @@ Result Validator::CheckEventVar(const Var* var, const Event** out_event) {
}
void Validator::CheckEvent(const Location* loc, const Event* event) {
- for (Type ty : event->sig) {
- switch (ty) {
- case Type::I32:
- case Type::I64:
- case Type::F32:
- case Type::F64:
- case Type::V128:
- break;
- default:
- PrintError(loc, "Invalid event type: %s", GetTypeName(ty));
- break;
- }
+ CheckFuncSignature(loc, event->decl);
+ if (event->decl.sig.GetNumResults() > 0) {
+ PrintError(loc, "Event signature must have 0 results.");
}
}