diff --git a/src/asmjs/asm-wasm-builder.cc b/src/asmjs/asm-wasm-builder.cc index bb9f14dea3..79845fcbe7 100644 --- a/src/asmjs/asm-wasm-builder.cc +++ b/src/asmjs/asm-wasm-builder.cc @@ -782,7 +782,10 @@ class AsmWasmBuilderImpl final : public AstVisitor { void PopulateFunctionTable(VariableProxy* table, ArrayLiteral* funcs) { FunctionTableIndices* indices = LookupFunctionTable(table->var()); - DCHECK_NOT_NULL(indices); + // Ignore unused function tables. + if (indices == nullptr) { + return; + } for (int i = 0; i < funcs->values()->length(); ++i) { VariableProxy* func = funcs->values()->at(i)->AsVariableProxy(); DCHECK_NOT_NULL(func); diff --git a/test/mjsunit/asm/regress-669899.js b/test/mjsunit/asm/regress-669899.js new file mode 100644 index 0000000000..7adf45b911 --- /dev/null +++ b/test/mjsunit/asm/regress-669899.js @@ -0,0 +1,27 @@ +// 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. + +try { +(function () { +})(); +} catch(e) {; } + function __f_113() { + } +(function () { +function __f_89() { + "use asm"; + function __f_63(__v_26, __v_28) { + __v_26 = __v_26|0; + __v_28 = __v_28|0; + } + function __f_21(table_id, fun_id, arg1, arg2) { + table_id = table_id|0; + fun_id = fun_id|0; + arg1 = arg1|0; + arg2 = arg2|0; + } + var __v_17 = []; +} +var module = __f_89(); +})();