diff options
author | kgallowa <kgallowa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-06 18:22:28 +0000 |
---|---|---|
committer | kgallowa <kgallowa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-06 18:22:28 +0000 |
commit | ae422aea7088fbe544a1547f91b95547f43b4509 (patch) | |
tree | 9fe206fae105ae05d810fe654bdf04bb62da04cf /libjava/jvmti.cc | |
parent | 6f020cc13bf16672487b4f5aa5515b6a14ff79a6 (diff) | |
download | gcc-ae422aea7088fbe544a1547f91b95547f43b4509.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122630 138bc75d-0d04-0410-961f-82ee72b054a4
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 faa7401c1ce..068878793d5 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); |