diff options
author | Kyle Galloway <kgallowa@redhat.com> | 2007-03-06 18:22:28 +0000 |
---|---|---|
committer | Kyle Galloway <kgallowa@gcc.gnu.org> | 2007-03-06 18:22:28 +0000 |
commit | 61a36e0df4c8372e2e0383a62649c15f5adddca2 (patch) | |
tree | 9fe206fae105ae05d810fe654bdf04bb62da04cf /libjava/jvmti.cc | |
parent | 4ba851b58beb3102b31fb4282fdea684dfa6865a (diff) | |
download | gcc-61a36e0df4c8372e2e0383a62649c15f5adddca2.zip gcc-61a36e0df4c8372e2e0383a62649c15f5adddca2.tar.gz gcc-61a36e0df4c8372e2e0383a62649c15f5adddca2.tar.bz2 |
jvmti.cc (_Jv_JVMTI_GetLocalVariableTable): Fix _Jv_Malloc parameters.
2007-03-06 Kyle Galloway <kgallowa@redhat.com>
* jvmti.cc(_Jv_JVMTI_GetLocalVariableTable): Fix _Jv_Malloc parameters.
* testsuite/libjava.jvmti/interp/natgetlocalvartable.cc
(do_getlocalvartable_tests): Add Deallocate calls to free strings.
From-SVN: r122630
Diffstat (limited to 'libjava/jvmti.cc')
-rw-r--r-- | libjava/jvmti.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libjava/jvmti.cc b/libjava/jvmti.cc index faa7401..0688787 100644 --- a/libjava/jvmti.cc +++ b/libjava/jvmti.cc @@ -997,23 +997,23 @@ _Jv_JVMTI_GetLocalVariableTable (MAYBE_UNUSED jvmtiEnv *env, jmethodID method, table_slot) >= 0) { + char **str_ptr = &(*locals)[table_slot].name; jerr = env->Allocate (static_cast<jlong> (strlen (name) + 1), - reinterpret_cast<unsigned char **> - (&(*locals)[table_slot].name)); + reinterpret_cast<unsigned char **> (str_ptr)); if (jerr != JVMTI_ERROR_NONE) return jerr; strcpy ((*locals)[table_slot].name, name); - - jerr = env->Allocate (static_cast<jlong> (strlen (name) + 1), - reinterpret_cast<unsigned char **> - (&(*locals)[table_slot].signature)); + + str_ptr = &(*locals)[table_slot].signature; + jerr = env->Allocate (static_cast<jlong> (strlen (sig) + 1), + reinterpret_cast<unsigned char **> (str_ptr)); if (jerr != JVMTI_ERROR_NONE) return jerr; strcpy ((*locals)[table_slot].signature, sig); - - jerr = env->Allocate (static_cast<jlong> (strlen (name) + 1), - reinterpret_cast<unsigned char **> - (&(*locals)[table_slot].generic_signature)); + + str_ptr = &(*locals)[table_slot].generic_signature; + jerr = env->Allocate (static_cast<jlong> (strlen (generic_sig) + 1), + reinterpret_cast<unsigned char **> (str_ptr)); if (jerr != JVMTI_ERROR_NONE) return jerr; strcpy ((*locals)[table_slot].generic_signature, generic_sig); |