Permalink
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...
1 parent 6400231 commit f38c4e25c6d8fa1fdfd9f25134fce14c4bb7fab8 @dicej dicej committed Apr 23, 2013
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/avian/classpath-common.h
@@ -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;

0 comments on commit f38c4e2

Please sign in to comment.