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

Unified Diff: runtime/lib/integers.dart

Issue 1177063002: Detect zero receiver of modInverse (may not converge and time out (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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/lib/bigint.dart ('k') | sdk/lib/_internal/compiler/js_lib/js_number.dart » ('j') | 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 5bee4047dbd11db280680ebdff7e562ee85e1368..7302e19fc0c78e41f479501922d84d25713a0fd9 100644
--- a/runtime/lib/integers.dart
+++ b/runtime/lib/integers.dart
@@ -297,6 +297,7 @@ class _IntegerImplementation extends _Num {
if (m is _Bigint) {
return _toBigint().modInverse(m);
}
+ if (this == 0) return 0;
bool ac = m.isEven;
int u = m;
int v = this;
« no previous file with comments | « runtime/lib/bigint.dart ('k') | sdk/lib/_internal/compiler/js_lib/js_number.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698