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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 1197263002: Fix crash in modPow (issue 23693); various bigint knowledge missing. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: c 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
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index fb55f660f397e597849ddd6bd71d4f0e290e08bf..cc17570f555e362f5e4bf34f2098477e93f7939e 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1656,7 +1656,7 @@ RawInteger* BinaryIntegerOpInstr::Evaluate(const Integer& left,
case Token::kTRUNCDIV:
case Token::kMOD:
// Check right value for zero.
- if (right.AsInt64Value() == 0) {
+ if (right.IsSmi() && right.AsInt64Value() == 0) {
break; // Will throw.
}
// Fall through.

Powered by Google App Engine
This is Rietveld 408576698