Commit 98b71a21 authored by Deepti Gandluri's avatar Deepti Gandluri Committed by Commit Bot

[wasm] Throw verbose errors for experimental local types

Change-Id: I0607978da6c346c5f8807b0c9a33e0245cd503e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1738470Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63105}
parent 71877cf7
......@@ -847,7 +847,9 @@ class WasmDecoder : public Decoder {
type = kWasmAnyRef;
break;
}
decoder->error(decoder->pc() - 1, "invalid local type");
decoder->error(decoder->pc() - 1,
"invalid local type 'anyref', enable with "
"--experimental-wasm-anyref");
return false;
case kLocalFuncRef:
if (enabled.anyref) {
......@@ -855,7 +857,7 @@ class WasmDecoder : public Decoder {
break;
}
decoder->error(decoder->pc() - 1,
"local type 'funcref' is not enabled with "
"invalid local type 'funcref', enable with "
"--experimental-wasm-anyref");
return false;
case kLocalExnRef:
......@@ -863,14 +865,19 @@ class WasmDecoder : public Decoder {
type = kWasmExnRef;
break;
}
decoder->error(decoder->pc() - 1, "invalid local type");
decoder->error(decoder->pc() - 1,
"invalid local type 'exception ref', enable with "
"--experimental-wasm-eh");
return false;
case kLocalS128:
if (enabled.simd) {
type = kWasmS128;
break;
}
V8_FALLTHROUGH;
decoder->error(decoder->pc() - 1,
"invalid local type 'Simd128', enable with "
"--experimental-wasm-simd");
return false;
default:
decoder->error(decoder->pc() - 1, "invalid local type");
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment