Name: tb29552 Date: 02/16/2001
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
invoking a method through JDWP (cmd: JDWP_ClassType_InvokeMethod) with an array
of a primitive type (such as byte[]) as a method argument results in a back-end
crash.
this is caused by a bug in the function nextArgumentTypeTag (invoker.c):
////////////// begin original code
static jbyte
nextArgumentTypeTag(void **cursor)
{
char *tagPtr = *cursor;
jbyte argumentTag = (jbyte)*tagPtr;
if (*tagPtr != SIGNATURE_END_ARGS) {
/* Skip any class name or additional array modifiers */
if ((*tagPtr == JDWP_Tag_ARRAY) ||
(*tagPtr == JDWP_Tag_OBJECT)) {
tagPtr = strchr(tagPtr, SIGNATURE_END_CLASS);
JDI_ASSERT(tagPtr);
}
tagPtr++;
}
*cursor = tagPtr;
return argumentTag;
}
////////////// end original code
////////////// begin fixed code
static jbyte
nextArgumentTypeTag(void **cursor)
{
char *tagPtr = *cursor;
jbyte argumentTag = (jbyte)*tagPtr;
while (*tagPtr != SIGNATURE_END_ARGS) {
/* Skip any class name or additional array modifiers */
if (*tagPtr == JDWP_Tag_ARRAY) {
tagPtr++;
continue;
}
if (*tagPtr == JDWP_Tag_OBJECT) {
tagPtr = strchr(tagPtr, SIGNATURE_END_CLASS);
JDI_ASSERT(tagPtr);
}
tagPtr++;
break;
}
*cursor = tagPtr;
return argumentTag;
}
////////////// end fixed code
(Review ID: 117123)
======================================================================