[interpreter] Check argument types on invoke
diff --git a/interpreter/exec/eval.ml b/interpreter/exec/eval.ml index ab58bd0..452d942 100644 --- a/interpreter/exec/eval.ml +++ b/interpreter/exec/eval.ml
@@ -335,8 +335,8 @@ let invoke (func : func_inst) (vs : value list) : value list = let at = match func with Func.AstFunc (_,_, f) -> f.at | _ -> no_region in let FuncType (ins, out) = Func.type_of func in - if List.length vs <> List.length ins then - Crash.error at "wrong number of arguments"; + if List.map Values.type_of vs <> ins then + Crash.error at "wrong number or types of arguments"; let c = config empty_module_inst (List.rev vs) [Invoke func @@ at] in try List.rev (eval c) with Stack_overflow -> Exhaustion.error at "call stack exhausted"