Index: runtime/vm/intermediate_language_ia32.cc |
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc |
index e0bfb7f48534340d1b489a42a927445e74f2453b..d75867c357705ec4cc10110a54ae0e4fb90a53d2 100644 |
--- a/runtime/vm/intermediate_language_ia32.cc |
+++ b/runtime/vm/intermediate_language_ia32.cc |
@@ -6088,7 +6088,7 @@ void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
__ movl(left_lo, left_hi); // Shift by 32. |
__ sarl(left_hi, Immediate(31)); // Sign extend left hi. |
if (shift > 32) { |
- __ sarl(left_lo, Immediate(shift - 32)); |
+ __ sarl(left_lo, Immediate(shift > 63 ? 31 : shift - 32)); |
} |
} else { |
__ shrdl(left_lo, left_hi, Immediate(shift)); |
@@ -6097,6 +6097,7 @@ void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
break; |
} |
case Token::kSHL: { |
+ ASSERT(shift < 64); |
if (can_overflow()) { |
Register temp1 = locs()->temp(0).reg(); |
Register temp2 = locs()->temp(1).reg(); |