Commit 2ed278f0 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[asm.js] Fix checking of "fround" in parameter annotation.

R=clemensh@chromium.org
TEST=mjsunit/asm/regress-718745
BUG=chromium:718745

Change-Id: I4d31e90d7a2bbb1d07ce946682a95582f63c7e27
Reviewed-on: https://chromium-review.googlesource.com/497469Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45134}
parent 642478bb
......@@ -833,7 +833,8 @@ void AsmJsParser::ValidateFunctionParams(std::vector<AsmType*>* params) {
info->index = static_cast<uint32_t>(params->size());
params->push_back(AsmType::Double());
} else {
if (!GetVarInfo(Consume())->type->IsA(stdlib_fround_)) {
if (!scanner_.IsGlobal() ||
!GetVarInfo(Consume())->type->IsA(stdlib_fround_)) {
FAIL("Expected fround");
}
EXPECT_TOKEN('(');
......
// Copyright 2017 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.
function Module(stdlib) {
"use asm";
var fround = stdlib.Math.fround;
function f(a) {
a = (fround(a));
}
return { f:f };
}
Module(this).f();
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