This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] JVMTI GetArgumentsSize


>>>>> "Kyle" == Kyle Galloway <kgallowa@redhat.com> writes:

Kyle> As requested, I have changed this to determine the arguments size by 
Kyle> looking at the method signature.  Patch is attached.

Kyle> +  sig = strtok (sig, ")");

Don't use strtok.  It writes to the string and it is not thread-safe.

Kyle> +  for (int i = 0; i < strlen (sig); i++)

You generally don't want to use strlen(sig) in a loop test.
Instead, here, end when sig[i] == ')'.

Kyle> +          || sig[i] == 'I' || sig[i] == 'F' || sig[i] == 'L')

For the 'L' case you have to search forward to the terminating ';'.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]