Skip to content

Commit

Permalink
[vm/compiler] Don't propagate non-constants as constants.
Browse files Browse the repository at this point in the history
Change-Id: Icf56be9657c16596adfdd3083f1154c53933d10b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116524
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
  • Loading branch information
sstrickl authored and commit-bot@chromium.org committed Sep 11, 2019
1 parent 46b5839 commit 488a8ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/vm/compiler/backend/constant_propagator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ void ConstantPropagator::VisitLoadStaticField(LoadStaticFieldInstr* instr) {
Instance& obj = Instance::Handle(Z, field.StaticValue());
if (field.is_final() && (obj.raw() != Object::sentinel().raw()) &&
(obj.raw() != Object::transition_sentinel().raw())) {
if (obj.IsSmi() || obj.IsOld()) {
if (obj.IsSmi() || (obj.IsOld() && obj.IsCanonical())) {
SetValue(instr, obj);
return;
}
Expand Down

0 comments on commit 488a8ae

Please sign in to comment.