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

Unified Diff: runtime/vm/simulator_mips.cc

Issue 17634003: Fixes bugs in arm and mips intrinsifier. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 months 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 | « runtime/vm/intrinsifier_mips.cc ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/simulator_mips.cc
===================================================================
--- runtime/vm/simulator_mips.cc (revision 24426)
+++ runtime/vm/simulator_mips.cc (working copy)
@@ -1650,7 +1650,13 @@
switch (instr->FormatField()) {
case FMT_D: {
double fs_dbl = get_fregister_double(instr->FsField());
- int32_t fs_int = static_cast<int32_t>(fs_dbl);
+ int32_t fs_int;
+ if (isnan(fs_dbl) || isinf(fs_dbl) || (fs_dbl > INT_MAX) ||
+ (fs_dbl < INT_MIN)) {
+ fs_int = INT_MIN;
+ } else {
+ fs_int = static_cast<int32_t>(fs_dbl);
+ }
set_fregister(instr->FdField(), fs_int);
break;
}
« no previous file with comments | « runtime/vm/intrinsifier_mips.cc ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698