From 77329439d6307d292e59986db3a194c3085abbe2 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Wed, 8 Jan 2020 17:43:25 -0800 Subject: Remove implicit conversion operators from Type (#2577) * Remove implicit conversion operators from Type Now types must be explicitly converted to uint32_t with Type::getID or to ValueType with Type::getVT. This fixes #2572 for switches that use Type::getVT. * getVT => getSingle --- src/wasm/wasm-validator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/wasm/wasm-validator.cpp') diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 30e182f0b..484376358 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -172,7 +172,7 @@ struct ValidationInfo { Expression* curr, const char* text, Function* func = nullptr) { - switch (ty) { + switch (ty.getSingle()) { case Type::i32: case Type::i64: case Type::unreachable: { @@ -1227,7 +1227,7 @@ void FunctionValidator::visitMemoryFill(MemoryFill* curr) { void FunctionValidator::validateMemBytes(uint8_t bytes, Type type, Expression* curr) { - switch (type) { + switch (type.getSingle()) { case Type::i32: shouldBeTrue(bytes == 1 || bytes == 2 || bytes == 4, curr, @@ -1975,7 +1975,7 @@ void FunctionValidator::validateAlignment( } } shouldBeTrue(align <= bytes, curr, "alignment must not exceed natural"); - switch (type) { + switch (type.getSingle()) { case Type::i32: case Type::f32: { shouldBeTrue(align <= 4, curr, "alignment must not exceed natural"); -- cgit v1.2.3