Index: runtime/lib/bigint.dart |
diff --git a/runtime/lib/bigint.dart b/runtime/lib/bigint.dart |
index 60b42454946acfb08790da4bd7c2fb8c23c8ee11..27c27fa7157c0d374036dc8206613aa0b030048f 100644 |
--- a/runtime/lib/bigint.dart |
+++ b/runtime/lib/bigint.dart |
@@ -1542,6 +1542,7 @@ class _Bigint extends _IntegerImplementation implements int { |
int modInverse(int m) { |
if (m is! int) throw new ArgumentError(m); |
if (m <= 0) throw new RangeError(m); |
+ if (_used == 0) return 0; |
m = m._toBigint(); |
// TODO(regis): Implement modInverse for an even modulus. |
if (m.isEven) throw new UnimplementedError(); |