summaryrefslogtreecommitdiffstats
path: root/runtime/interpreter/interpreter_common.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-03-21 11:44:43 -0700
committerAndreas Gampe <agampe@google.com>2014-03-21 11:47:17 -0700
commit7104cbf9c594563c6daae592b8f38f49a423d12e (patch)
tree71cd3aa726d7ad946f314e41e465b39cb6b8b8c0 /runtime/interpreter/interpreter_common.cc
parentfaa93b3ab455492dad1a9d3fb630e3936d389c85 (diff)
downloadart-7104cbf9c594563c6daae592b8f38f49a423d12e.zip
art-7104cbf9c594563c6daae592b8f38f49a423d12e.tar.gz
art-7104cbf9c594563c6daae592b8f38f49a423d12e.tar.bz2
Fix sign problem, implement low-mem mmap wraparound
A signed value comparison meant that on 64b systems comparisons were false when pointers > 2GB were in use (as happens in long-running tests). Fix this to be uint. Implement a simple wrap-around in the MAP_32BIT emulation code. Change-Id: I09870b4755f2dca676e42e701fbb6f6eb4bb95d0
Diffstat (limited to 'runtime/interpreter/interpreter_common.cc')
-rw-r--r--runtime/interpreter/interpreter_common.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index e8cea9d..297f1a8 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -30,9 +30,10 @@ static inline void AssignRegister(ShadowFrame* new_shadow_frame, const ShadowFra
size_t dest_reg, size_t src_reg)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
// If both register locations contains the same value, the register probably holds a reference.
- int32_t src_value = shadow_frame.GetVReg(src_reg);
+ // Uint required, so that sign extension does not make this wrong on 64b systems
+ uint32_t src_value = shadow_frame.GetVReg(src_reg);
mirror::Object* o = shadow_frame.GetVRegReference<kVerifyNone>(src_reg);
- if (src_value == reinterpret_cast<intptr_t>(o)) {
+ if (src_value == reinterpret_cast<uintptr_t>(o)) {
new_shadow_frame->SetVRegReference(dest_reg, o);
} else {
new_shadow_frame->SetVReg(dest_reg, src_value);