MIPS: Improvement of “MIPS: Fixed crashes exposed though fuzzing.” (r17886).
authorplind44@gmail.com <plind44@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 20 Nov 2013 19:33:50 +0000 (19:33 +0000)
committerplind44@gmail.com <plind44@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 20 Nov 2013 19:33:50 +0000 (19:33 +0000)
BUG=
R=plind44@gmail.com

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

Patch from Balazs Kilvady <kilvadyb@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17942 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/mips/macro-assembler-mips.cc

index 05f2536..cb336f3 100644 (file)
@@ -5082,8 +5082,8 @@ void MacroAssembler::EmitSeqStringSetCharCheck(Register string,
   lw(at, FieldMemOperand(string, String::kLengthOffset));
   ThrowIf(ge, kIndexIsTooLarge, index, Operand(at));
 
-  li(at, Operand(Smi::FromInt(0)));
-  ThrowIf(lt, kIndexIsNegative, index, Operand(at));
+  ASSERT(Smi::FromInt(0) == 0);
+  ThrowIf(lt, kIndexIsNegative, index, Operand(zero_reg));
 
   SmiUntag(index, index);
 }