Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix array class name length calculation in invoke

The original calculation ommitted the last character, changing
e.g. "[I" into "[".
  • Loading branch information...
commit f38c4e25c6d8fa1fdfd9f25134fce14c4bb7fab8 1 parent 6400231
Joel Dice dicej authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/avian/classpath-common.h
10 src/avian/classpath-common.h
View
@@ -527,10 +527,16 @@ invoke(Thread* t, object method, object instance, object args)
case 'J': type = vm::type(t, Machine::LongType); break;
case 'D': type = vm::type(t, Machine::DoubleType); break;
- case 'L': ++ p;
+ case 'L':
case '[': {
objectType = true;
- unsigned nameLength = it.s - p;
+ unsigned nameLength;
+ if (*p == 'L') {
+ ++ p;
+ nameLength = it.s - p;
+ } else {
+ nameLength = (it.s - p) + 1;
+ }
THREAD_RUNTIME_ARRAY(t, char, name, nameLength);
memcpy(RUNTIME_ARRAY_BODY(name), p, nameLength - 1);
RUNTIME_ARRAY_BODY(name)[nameLength - 1] = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.