Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Unified Diff: vm/intrinsifier_ia32.cc

Issue 8931016: Fix truncate divide bug (reported by sra) when dividing MIN_SMI by -1. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | vm/opt_code_generator_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/intrinsifier_ia32.cc
===================================================================
--- vm/intrinsifier_ia32.cc (revision 2397)
+++ vm/intrinsifier_ia32.cc (working copy)
@@ -368,8 +368,14 @@
__ SmiUntag(EBX);
__ movl(EAX, Address(ESP, + 2 * kWordSize)); // Left argument (dividend).
__ SmiUntag(EAX);
+ __ pushl(EDX); // Preserve EDX in case of 'fall_through'.
__ cdq();
__ idivl(EBX);
+ __ popl(EDX);
+ // Check the corner case of dividing the 'MIN_SMI' with -1, in which case we
+ // cannot tag the result.
+ __ cmpl(EAX, Immediate(0x40000000));
+ __ j(EQUAL, &fall_through);
__ SmiTag(EAX);
__ ret();
__ Bind(&fall_through);
« no previous file with comments | « no previous file | vm/opt_code_generator_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698