Commit 98c23129 authored by titzer's avatar titzer Committed by Commit bot

[wasm] Fix bug with empty input to Wasm.instantiateModuleFromAsm()

R=ahaas@chromium.org,bradnelson@chromium.org
BUG=chromium:605488
LOG=Y

Review-Url: https://codereview.chromium.org/1940243002
Cr-Commit-Position: refs/heads/master@{#35974}
parent 18c380c3
......@@ -134,6 +134,11 @@ v8::internal::wasm::WasmModuleIndex* TranslateAsmModule(
return nullptr;
}
if (info->scope()->declarations()->length() == 0) {
thrower->Error("Asm.js validation failed: no declarations in scope");
return nullptr;
}
info->set_literal(
info->scope()->declarations()->at(0)->AsFunctionDeclaration()->fun());
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --expose-wasm
try {
Wasm.instantiateModuleFromAsm("");
assertTrue(false);
} catch (e) {
print("Caught: " + e);
}
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