Commit 77a8c2ea authored by titzer's avatar titzer Committed by Commit bot

[asm.js] Fix typing bug for non-literals in heap access.

R=bradnelson@chromium.org
BUG=chromium:599825
LOG=Y

Review URL: https://codereview.chromium.org/1858263002

Cr-Commit-Position: refs/heads/master@{#35273}
parent 6dda75f2
......@@ -781,7 +781,7 @@ void AsmTyper::VisitHeapAccess(Property* expr, bool assigning,
"array index expected to be integer"));
Literal* right = bin->right()->AsLiteral();
if (right == NULL || right->raw_value()->ContainsDot()) {
FAIL(right, "heap access shift must be integer");
FAIL(bin->right(), "heap access shift must be integer");
}
RECURSE(VisitWithExpectation(bin->right(), cache_.kAsmSigned,
"array shift expected to be integer"));
......
// 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
function __f_97(stdlib, buffer) {
"use asm";
var __v_30 = new stdlib.Int32Array(buffer);
function __f_74() {
var __v_27 = 4;
__v_30[__v_27 >> __v_2] = ((__v_30[-1073741825]|-10) + 2) | 0;
}
}
assertThrows(function() {
var module = Wasm.instantiateModuleFromAsm( __f_97.toString());
});
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