Fix incorrect register-number range check.
For the JVMTI Get/SetLocalVariable functions we were checking the slot
number as though it was unsigned when in fact it is held as a (signed)
jint.
Test: ./art/tools/run-libjdwp-tests.sh --mode=host
Test: ./test.py --host
Change-Id: I9bbc0054ae48884cd8ddf84b5cbd60d5247bf43b
diff --git a/openjdkjvmti/ti_method.cc b/openjdkjvmti/ti_method.cc
index 408ce69..e34a856 100644
--- a/openjdkjvmti/ti_method.cc
+++ b/openjdkjvmti/ti_method.cc
@@ -548,7 +548,7 @@
// TODO It might be useful to fake up support for get at least on proxy frames.
result_ = ERR(OPAQUE_FRAME);
return;
- } else if (method->DexInstructionData().RegistersSize() <= slot_) {
+ } else if (slot_ >= method->DexInstructionData().RegistersSize() || slot_ < 0) {
result_ = ERR(INVALID_SLOT);
return;
}