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

Unified Diff: pkg/compiler/lib/src/ssa/nodes.dart

Issue 1934553002: Avoid use of NonConstantValue in SSA (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/compiler/lib/src/ssa/nodes.dart
diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
index c9a4c2a328cb5afbdd663ce2c8ba12eb08c39863..3b119bddb7984a5382b6a7de9b96cfcd120de00d 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -198,6 +198,10 @@ class HGraph {
HConstant result = constants[constant];
// TODO(johnniwinther): Support source information per constant reference.
if (result == null) {
+ if (!constant.isConstant) {
+ // We use `null` as the value for invalid constant expressions.
+ constant = const NullConstantValue();
+ }
TypeMask type = computeTypeMask(compiler, constant);
result = new HConstant.internal(constant, type)
..sourceInformation = sourceInformation;
« pkg/compiler/lib/src/constants/values.dart ('K') | « pkg/compiler/lib/src/constants/values.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698