Bug 1265461: Simple fixes to get a few tests working; r=luke
authorBenjamin Bouvier <benj@benj.me>
Thu, 28 Apr 2016 14:20:57 +0200
changeset 297344 8817ba456f6d168028b2b03c52978de4df73c199
parent 297343 4f43207abcb992d1604c8047c2cab3f3e6db7966
child 297345 92ddd15e624e1a102cf27b0365f31d73b2f41051
push id19218
push userkwierso@gmail.com
push dateFri, 13 May 2016 23:46:15 +0000
treeherderfx-team@93d60e9db618 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1265461
milestone49.0a1
Bug 1265461: Simple fixes to get a few tests working; r=luke MozReview-Commit-ID: 3UwJUw5S6Y
js/src/asmjs/WasmTextToBinary.cpp
js/src/js.msg
--- a/js/src/asmjs/WasmTextToBinary.cpp
+++ b/js/src/asmjs/WasmTextToBinary.cpp
@@ -3540,16 +3540,19 @@ ResolveBranchTable(Resolver& r, WasmAstB
     if (!r.resolveBranchTarget(bt.def()))
         return false;
 
     for (WasmRef& elem : bt.table()) {
         if (!r.resolveBranchTarget(elem))
             return false;
     }
 
+    if (bt.maybeValue() && !ResolveExpr(r, *bt.maybeValue()))
+        return false;
+
     return ResolveExpr(r, bt.index());
 }
 
 static bool
 ResolveExpr(Resolver& r, WasmAstExpr& expr)
 {
     switch (expr.kind()) {
       case WasmAstExprKind::Nop:
--- a/js/src/js.msg
+++ b/js/src/js.msg
@@ -342,17 +342,17 @@ MSG_DEF(JSMSG_USE_ASM_TYPE_OK,         1
 
 // wasm
 MSG_DEF(JSMSG_WASM_FAIL,               1, JSEXN_TYPEERR, "wasm error: {0}")
 MSG_DEF(JSMSG_WASM_DECODE_FAIL,        2, JSEXN_TYPEERR, "wasm validation error at offset {0}: {1}")
 MSG_DEF(JSMSG_WASM_TEXT_FAIL,          1, JSEXN_SYNTAXERR, "wasm text error: {0}")
 MSG_DEF(JSMSG_WASM_BAD_IND_CALL,       0, JSEXN_ERR,     "wasm indirect call signature mismatch")
 MSG_DEF(JSMSG_WASM_BAD_BUF_ARG,        0, JSEXN_TYPEERR, "first argument must be a typed array")
 MSG_DEF(JSMSG_WASM_BAD_IMPORT_ARG,     0, JSEXN_TYPEERR, "second argument, if present, must be an object")
-MSG_DEF(JSMSG_WASM_UNREACHABLE,        0, JSEXN_ERR,     "reached unreachable trap")
+MSG_DEF(JSMSG_WASM_UNREACHABLE,        0, JSEXN_ERR,     "unreachable executed")
 MSG_DEF(JSMSG_WASM_INTEGER_OVERFLOW,   0, JSEXN_ERR,     "integer overflow")
 MSG_DEF(JSMSG_WASM_INVALID_CONVERSION, 0, JSEXN_ERR,     "invalid conversion to integer")
 MSG_DEF(JSMSG_WASM_INT_DIVIDE_BY_ZERO, 0, JSEXN_ERR,     "integer divide by zero")
 
 // Proxy
 MSG_DEF(JSMSG_BAD_TRAP_RETURN_VALUE,   2, JSEXN_TYPEERR,"trap {1} for {0} returned a primitive value")
 MSG_DEF(JSMSG_BAD_GETPROTOTYPEOF_TRAP_RETURN,0,JSEXN_TYPEERR,"proxy getPrototypeOf handler returned a non-object, non-null value")
 MSG_DEF(JSMSG_INCONSISTENT_GETPROTOTYPEOF_TRAP,0,JSEXN_TYPEERR,"proxy getPrototypeOf handler didn't return the target object's prototype")