Commit 5ca16fb8 authored by palfia@homejinni.com's avatar palfia@homejinni.com

MIPS: Check in Lithium that allocation size in Smi range.

Port r20458 (984d99c9)

Oirginal commit message:
This is to avoid triggering an assertion from Smi::FromInt. The
generated code is unreachable, so it is not a real bug.

BUG=
R=plind44@gmail.com

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20491 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4c124982
......@@ -5371,7 +5371,13 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
__ push(size);
} else {
int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
__ Push(Smi::FromInt(size));
if (size >= 0 && size <= Smi::kMaxValue) {
__ Push(Smi::FromInt(size));
} else {
// We should never get here at runtime => abort
__ stop("invalid allocation size");
return;
}
}
int flags = AllocateDoubleAlignFlag::encode(
......
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