From 5e6926cf67b50bcab56dc244e09b6f8f608d4ca2 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Sat, 27 Jun 2015 13:44:06 +0100 Subject: [PATCH] Quick: Fix a DCHECK to take type conflicts into account. Bug: 21865466 Change-Id: I010c7058b5a58bea1ec61af5bd6a12c2eb8de1b4 --- compiler/dex/quick/gen_loadstore.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/dex/quick/gen_loadstore.cc b/compiler/dex/quick/gen_loadstore.cc index aa95e77f6..3f8900177 100644 --- a/compiler/dex/quick/gen_loadstore.cc +++ b/compiler/dex/quick/gen_loadstore.cc @@ -107,7 +107,9 @@ void Mir2Lir::LoadValueDirectWideFixed(RegLocation rl_src, RegStorage r_dest) { } RegLocation Mir2Lir::LoadValue(RegLocation rl_src, RegisterClass op_kind) { - DCHECK(!rl_src.ref || op_kind == kRefReg); + // If op_kind isn't a reference, rl_src should not be marked as a reference either + // unless we've seen type conflicts (i.e. register promotion is disabled). + DCHECK(op_kind == kRefReg || (!rl_src.ref || (cu_->disable_opt & (1u << kPromoteRegs)) != 0u)); rl_src = UpdateLoc(rl_src); if (rl_src.location == kLocPhysReg) { if (!RegClassMatches(op_kind, rl_src.reg)) { -- 2.11.0