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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 2793003002: VM: Fix incorrect canonicalization rule for `UnboxedIntConverterInstr`. (Closed)
Patch Set: Address comments Created 3 years, 9 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
« no previous file with comments | « no previous file | tests/language/vm/regress_29137_vm_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 4d781eb5b752ae4f7831761efd799a0690177aad..0b5f48ed37ddae3458a12351e93b897dbc115213 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -2310,6 +2310,11 @@ Definition* UnboxedIntConverterInstr::Canonicalize(FlowGraph* flow_graph) {
value()->definition()->AsUnboxedIntConverter();
if ((box_defn != NULL) && (box_defn->representation() == from())) {
if (box_defn->from() == to()) {
+ // Do not erase truncating convertions from 64-bit value to 32-bit values
+ // because such convertions erase upper 32 bits.
+ if ((box_defn->from() == kUnboxedMint) && box_defn->is_truncating()) {
+ return this;
+ }
return box_defn->value()->definition();
}
« no previous file with comments | « no previous file | tests/language/vm/regress_29137_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698