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

Unified Diff: runtime/vm/object.cc

Issue 1424733005: Fixes bad C++ code generation by XCode 7 (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Typo Created 5 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 34208c73d96d222a668b6cc7a7860ec5fa7d88a0..dd5177d3d6c38a37737e1a15776544143a8e46fa 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -17298,8 +17298,12 @@ RawInteger* Integer::ArithmeticOp(Token::Kind operation,
break;
}
case Token::kSUB: {
- if (((left_value < 0) == (right_value < 0)) ||
- ((left_value - right_value) < 0) == (left_value < 0)) {
+ // TODO(srdjan): Investigate why XCode 7 produces wrong code
+ // if the comparison is inlined as in above (Token::kADD).
+ const bool both_same_sign = (left_value < 0) == (right_value < 0);
+ const bool result_same_sign_as_left =
+ ((left_value - right_value) < 0) == (left_value < 0);
+ if (both_same_sign || result_same_sign_as_left) {
return Integer::New(left_value - right_value, space);
}
break;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698