From a18d30fb42838f2e4002338d6e57a25322f9e422 Mon Sep 17 00:00:00 2001 From: Daniel Wirtz Date: Thu, 20 Aug 2020 01:36:17 +0200 Subject: Replace Type::expand() with an iterator-based approach (#3061) This leads to simpler code and is a prerequisite for #3012, which makes it so that not all `Type`s are backed by vectors that `expand` could return. --- src/wasm-interpreter.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/wasm-interpreter.h') diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 4f0d22e58..baeda0612 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -1890,14 +1890,12 @@ private: WASM_UNREACHABLE("invalid param count"); } locals.resize(function->getNumLocals()); - const std::vector& params = function->sig.params.expand(); for (size_t i = 0; i < function->getNumLocals(); i++) { if (i < arguments.size()) { - assert(i < params.size()); - if (!Type::isSubType(arguments[i].type, params[i])) { + if (!Type::isSubType(arguments[i].type, function->sig.params[i])) { std::cerr << "Function `" << function->name << "` expects type " - << params[i] << " for parameter " << i << ", got " - << arguments[i].type << "." << std::endl; + << function->sig.params[i] << " for parameter " << i + << ", got " << arguments[i].type << "." << std::endl; WASM_UNREACHABLE("invalid param count"); } locals[i] = {arguments[i]}; -- cgit v1.2.3