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

Unified Diff: runtime/lib/integers.dart

Issue 2557713002: Avoid bigints entering non-bigint gcd implementation. (Closed)
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/integers.dart
diff --git a/runtime/lib/integers.dart b/runtime/lib/integers.dart
index f465e3bd6bc27a8ccc00482e54e26281ae2ad725..e87dba700b759503669df13e4622ceee8f6541d1 100644
--- a/runtime/lib/integers.dart
+++ b/runtime/lib/integers.dart
@@ -394,8 +394,8 @@ abstract class _IntegerImplementation {
if (x == 0) return y;
if (y == 0) return x;
if ((x == 1) || (y == 1)) return 1;
- if (other is _Bigint) {
- return _toBigint().gcd(other);
+ if (y is _Bigint) {
+ return x._toBigint().gcd(y);
Lasse Reichstein Nielsen 2016/12/06 09:05:23 If other is -0x8000000000000000 (aka min-mint) the
regis 2016/12/06 17:08:15 Agreed.
}
return _binaryGcd(x, y, false);
}
« 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