From 5c2555407d823356fb55ea3ffdf281aac00a583e Mon Sep 17 00:00:00 2001 From: Serguei Katkov Date: Thu, 6 Nov 2014 14:45:44 +0600 Subject: Use correct register class for refs LoadValue requires thar ref location should reguest kRefReg register class. The patch fixes GenFilledNewArray to specify the register class correctly. This is a fix for the crash of dex2oat on 412-new-array unit test. Change-Id: I58d969ddac0d84d4024bf686b5b0c12337ca9a37 Signed-off-by: Serguei Katkov --- compiler/dex/quick/gen_common.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/dex/quick/gen_common.cc') diff --git a/compiler/dex/quick/gen_common.cc b/compiler/dex/quick/gen_common.cc index 061ee0747a..9cf601bc37 100644 --- a/compiler/dex/quick/gen_common.cc +++ b/compiler/dex/quick/gen_common.cc @@ -481,7 +481,7 @@ void Mir2Lir::GenFilledNewArray(CallInfo* info) { } else if (!info->is_range) { // TUNING: interleave for (int i = 0; i < elems; i++) { - RegLocation rl_arg = LoadValue(info->args[i], kCoreReg); + RegLocation rl_arg = LoadValue(info->args[i], info->args[i].ref ? kRefReg : kCoreReg); Store32Disp(ref_reg, mirror::Array::DataOffset(component_size).Int32Value() + i * 4, rl_arg.reg); // If the LoadValue caused a temp to be allocated, free it -- cgit v1.2.3-59-g8ed1b