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

Unified Diff: pkg/analyzer_experimental/lib/src/generated/constant.dart

Issue 29313003: Don't evaluate << because of possible overflow. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: pkg/analyzer_experimental/lib/src/generated/constant.dart
diff --git a/pkg/analyzer_experimental/lib/src/generated/constant.dart b/pkg/analyzer_experimental/lib/src/generated/constant.dart
index 7721c2c8687bbe6548e7660b557b90efa4acbcb5..12b536f361fbeafbe95e58724240fea424cc56a1 100644
--- a/pkg/analyzer_experimental/lib/src/generated/constant.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/constant.dart
@@ -970,7 +970,7 @@ class ValidResult extends EvaluationResultImpl {
* A result object representing the an arbitrary integer on which no further operations can be
* performed.
*/
- static ValidResult RESULT_INT = new ValidResult(null);
+ static ValidResult RESULT_INT = new ValidResult(0);
/**
* A result object representing the `null` value.
@@ -1096,6 +1096,12 @@ class ValidResult extends EvaluationResultImpl {
return valueOf4(((value as double)).toString());
} else if (value is String) {
return this;
+ } else if (isSomeBool) {
+ return valueOf4("<some bool>");
+ } else if (isSomeInt) {
+ return valueOf4("<some int>");
+ } else if (isSomeNum) {
+ return valueOf4("<some num>");
}
return error(node);
}
@@ -1581,7 +1587,7 @@ class ValidResult extends EvaluationResultImpl {
return error(node.rightOperand);
} else if (leftValue is int) {
if (value is int) {
- return valueOf(((leftValue as int)) << ((value as int)));
+ return RESULT_INT;
}
return error(node.rightOperand);
}

Powered by Google App Engine
This is Rietveld 408576698