summaryrefslogtreecommitdiffstats
path: root/compiler/dex/quick/quick_cfi_test.cc
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-04-16 11:52:45 -0700
committerDan Albert <danalbert@google.com>2015-04-16 14:24:28 -0700
commitf903680dd74e1f353dae0f4155163839a6386bf9 (patch)
tree5a6c3405737a725faab4e87c4fbd71c5caf67058 /compiler/dex/quick/quick_cfi_test.cc
parente50dffa29fb6c67eba44e267aa890d35712de9dd (diff)
downloadandroid_art-f903680dd74e1f353dae0f4155163839a6386bf9.tar.gz
android_art-f903680dd74e1f353dae0f4155163839a6386bf9.tar.bz2
android_art-f903680dd74e1f353dae0f4155163839a6386bf9.zip
Fix value used for shift in quick_cfi_test.
The spill mask bit should be shifted by the register number, not the whole register mask. Previously this test was shifting by values well over the width of the type, which is undefined behavior. Change-Id: Idf750be6d95b4487f8f4570b8c7ff9dba38be9f2
Diffstat (limited to 'compiler/dex/quick/quick_cfi_test.cc')
-rw-r--r--compiler/dex/quick/quick_cfi_test.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/dex/quick/quick_cfi_test.cc b/compiler/dex/quick/quick_cfi_test.cc
index 2db5a366df..d276457d01 100644
--- a/compiler/dex/quick/quick_cfi_test.cc
+++ b/compiler/dex/quick/quick_cfi_test.cc
@@ -89,13 +89,13 @@ class QuickCFITest : public CFITest {
m2l->CompilerInitializeRegAlloc();
for (const auto& info : m2l->reg_pool_->core_regs_) {
if (m2l->num_core_spills_ < 2 && !info->IsTemp() && !info->InUse()) {
- m2l->core_spill_mask_ |= 1 << info->GetReg().GetReg();
+ m2l->core_spill_mask_ |= 1 << info->GetReg().GetRegNum();
m2l->num_core_spills_++;
}
}
for (const auto& info : m2l->reg_pool_->sp_regs_) {
if (m2l->num_fp_spills_ < 2 && !info->IsTemp() && !info->InUse()) {
- m2l->fp_spill_mask_ |= 1 << info->GetReg().GetReg();
+ m2l->fp_spill_mask_ |= 1 << info->GetReg().GetRegNum();
m2l->num_fp_spills_++;
}
}