changeset 2217:69ca4489c426

Fiddle
author Gary Benson <gbenson@redhat.com>
date Wed, 16 Feb 2011 10:41:53 +0000
parents b313354b49a5
children 931f823c1500
files src/cpu/zero/vm/cppInterpreter_zero.cpp
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/zero/vm/cppInterpreter_zero.cpp	Wed Feb 16 10:38:43 2011 +0000
+++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp	Wed Feb 16 10:41:53 2011 +0000
@@ -614,7 +614,8 @@
                                         intptr_t UNUSED, TRAPS) {
   JavaThread *thread = (JavaThread *) THREAD;
   ZeroStack *stack = thread->zero_stack();
-  intptr_t *locals = stack->sp() + (method->size_of_parameters() - 1);
+  int num_locals = method->size_of_parameters();
+  intptr_t *locals = stack->sp() + (num_locals - 1);
 
   // Get the MethodType
   address p = (address) method;
@@ -626,7 +627,8 @@
   // Get the MethodHandle
   oop mtform = java_dyn_MethodType::form(method_type);
   int vmslots = java_dyn_MethodTypeForm::vmslots(mtform);
-  assert(vmslots > 0, "should be"); vmslots--; // XXX why why why?
+  vmslots--; // XXX why why why?
+  assert(vmslots >= 0 && vmslots < num_locals, "should be");
   oop method_handle = LOCALS_OBJECT(vmslots);
 
   // Compare the method type against that of the receiver