summaryrefslogtreecommitdiff
path: root/src/shared-validator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared-validator.cc')
-rw-r--r--src/shared-validator.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/shared-validator.cc b/src/shared-validator.cc
index 214c4204..51c0edea 100644
--- a/src/shared-validator.cc
+++ b/src/shared-validator.cc
@@ -763,6 +763,23 @@ Result SharedValidator::OnCallIndirect(const Location& loc,
return result;
}
+Result SharedValidator::OnCallRef(const Location& loc, Index* function_type_index) {
+ Result result = Result::Ok;
+ expr_loc_ = &loc;
+ Index func_index;
+ result |= typechecker_.OnFuncRef(&func_index);
+ if (Failed(result)) {
+ return result;
+ }
+ FuncType func_type;
+ result |= CheckFuncTypeIndex(Var(func_index, loc), &func_type);
+ result |= typechecker_.OnCall(func_type.params, func_type.results);
+ if (Succeeded(result)) {
+ *function_type_index = func_index;
+ }
+ return result;
+}
+
Result SharedValidator::OnCatch(const Location& loc,
Var tag_var,
bool is_catch_all) {