Fix an issue parsing arrays of primitive types when parsing param lists

git-svn-id: https://smali.googlecode.com/svn/trunk@752 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
JesusFreke@JesusFreke.com 2010-06-13 20:34:00 +00:00
parent f65966da4f
commit 1fd0276b78

View File

@ -242,13 +242,16 @@ import org.jf.dexlib.Code.Format.*;
case '[': case '[':
{ {
int i = typeStartIndex; int i = typeStartIndex;
while (str.charAt(++i) == '['); while (str.charAt(++i) == '[');
while (str.charAt(++i) != ';');
token.setType(ARRAY_DESCRIPTOR); if (str.charAt(i++) == 'L') {
token.setText(str.substring(typeStartIndex, i + 1)); while (str.charAt(i++) != ';');
token.setStopIndex(baseToken.getStartIndex() + i); }
break;
token.setType(ARRAY_DESCRIPTOR);
token.setText(str.substring(typeStartIndex, i));
token.setStopIndex(baseToken.getStartIndex() + i - 1);
break;
} }
default: default:
throw new RuntimeException(String.format("Invalid character '\%c' in param list \"\%s\" at position \%d", str.charAt(typeStartIndex), str, typeStartIndex)); throw new RuntimeException(String.format("Invalid character '\%c' in param list \"\%s\" at position \%d", str.charAt(typeStartIndex), str, typeStartIndex));