Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index 5849cf4ef910d6573c75dd7b4858a964e75192b9..e4cd5cc26eec1612b3c110835cbcce1be8057ef5 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -2918,9 +2918,14 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { |
instr->index()->IsConstantOperand()) { |
int32_t const_index = ToInteger32(LConstantOperand::cast(instr->index())); |
int32_t const_length = ToInteger32(LConstantOperand::cast(instr->length())); |
- StackArgumentsAccessor args(arguments, const_length, |
- ARGUMENTS_DONT_CONTAIN_RECEIVER); |
- __ movp(result, args.GetArgumentOperand(const_index)); |
+ if (const_index < const_length) { |
+ StackArgumentsAccessor args(arguments, const_length, |
+ ARGUMENTS_DONT_CONTAIN_RECEIVER); |
+ __ movp(result, args.GetArgumentOperand(const_index)); |
+ } else { |
+ // This code should never be executed; just stop here. |
+ __ int3(); |
+ } |
} else { |
Register length = ToRegister(instr->length()); |
// There are two words between the frame pointer and the last argument. |