diff options
author | Sam Clegg <sbc@chromium.org> | 2021-12-13 09:47:07 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-13 09:47:07 -0800 |
commit | 930b00154136593db87fd99b6ff0a1656e9b69de (patch) | |
tree | 88ef00b4e0de234f9fffb892a690785f70b301b6 /src | |
parent | b8907a5a65e916c9c3f18baa9e8a0362afd19347 (diff) | |
download | wabt-930b00154136593db87fd99b6ff0a1656e9b69de.tar.gz wabt-930b00154136593db87fd99b6ff0a1656e9b69de.tar.bz2 wabt-930b00154136593db87fd99b6ff0a1656e9b69de.zip |
Fix param naming for `OnFuncRefExpr` (See #1768). NFC (#1786)
In #1768, I renamed the parameter to `OnFuncRefExpr` without realizing
that there are two distinct methods in the codebase with this name. On
is the `BinaryReader` callback which takes a function index and one is
the `TypeChecker` callback which takes a function *type* (a type index).
Diffstat (limited to 'src')
-rw-r--r-- | src/shared-validator.cc | 4 | ||||
-rw-r--r-- | src/type-checker.cc | 4 | ||||
-rw-r--r-- | src/type-checker.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/shared-validator.cc b/src/shared-validator.cc index 733ce027..9f54d3b7 100644 --- a/src/shared-validator.cc +++ b/src/shared-validator.cc @@ -940,8 +940,8 @@ Result SharedValidator::OnRefFunc(const Location& loc, Var func_var) { result |= CheckFuncIndex(func_var); if (Succeeded(result)) { check_declared_funcs_.push_back(func_var); - result |= - typechecker_.OnRefFuncExpr(GetFunctionTypeIndex(func_var.index())); + Index func_type = GetFunctionTypeIndex(func_var.index()); + result |= typechecker_.OnRefFuncExpr(func_type); } return result; } diff --git a/src/type-checker.cc b/src/type-checker.cc index e36bd984..1f6fd24b 100644 --- a/src/type-checker.cc +++ b/src/type-checker.cc @@ -774,9 +774,9 @@ Result TypeChecker::OnTableFill(Type elem_type) { return PopAndCheck3Types(Type::I32, elem_type, Type::I32, "table.fill"); } -Result TypeChecker::OnRefFuncExpr(Index func_index) { +Result TypeChecker::OnRefFuncExpr(Index func_type) { if (features_.function_references_enabled()) { - PushType(Type(Type::Reference, func_index)); + PushType(Type(Type::Reference, func_type)); } else { PushType(Type::FuncRef); } diff --git a/src/type-checker.h b/src/type-checker.h index 9fd0fe46..8794f837 100644 --- a/src/type-checker.h +++ b/src/type-checker.h @@ -111,7 +111,7 @@ class TypeChecker { Result OnTableGrow(Type elem_type); Result OnTableSize(); Result OnTableFill(Type elem_type); - Result OnRefFuncExpr(Index func_index); + Result OnRefFuncExpr(Index func_type); Result OnRefNullExpr(Type type); Result OnRefIsNullExpr(); Result OnRethrow(Index depth); |