mirror of
https://github.com/revanced/smali.git
synced 2025-05-02 15:44:30 +02:00
Improve error handling for missing reference_type_descriptor
This commit is contained in:
parent
a0149307bd
commit
bcc0d5fa64
@ -540,6 +540,11 @@ nonvoid_type_descriptor
|
||||
reference_type_descriptor
|
||||
: class_descriptor
|
||||
| array_descriptor;
|
||||
catch [RecognitionException re] {
|
||||
Marker marker = mark();
|
||||
recover(input, re);
|
||||
reportError(marker, re, false);
|
||||
}
|
||||
|
||||
null_literal
|
||||
@init { Marker marker = mark(); }
|
||||
|
@ -54,6 +54,7 @@ public class ParserTest extends LightCodeInsightParsingTestCase {
|
||||
public void testParamListInvalidParameter() throws Exception { doTest(true); }
|
||||
public void testSuperClassInvalidSyntax() throws Exception { doTest(true); }
|
||||
public void testSuperClassInvalidSyntax2() throws Exception { doTest(true); }
|
||||
public void testInvalidMethodReference() throws Exception { doTest(true); }
|
||||
public void testInvalidMethod() throws Exception { doTest(true); }
|
||||
public void testInvalidMethod2() throws Exception { doTest(true); }
|
||||
public void testInvalidMethod3() throws Exception { doTest(true); }
|
||||
|
4
smalidea/testData/InvalidMethodReference.smalidea
Normal file
4
smalidea/testData/InvalidMethodReference.smalidea
Normal file
@ -0,0 +1,4 @@
|
||||
.method blah()V
|
||||
.registers 1
|
||||
invoke-virtual {v0}, .blah->
|
||||
.end method
|
46
smalidea/testData/InvalidMethodReference.txt
Normal file
46
smalidea/testData/InvalidMethodReference.txt
Normal file
@ -0,0 +1,46 @@
|
||||
smali.FILE
|
||||
SmaliClass(CLASS)
|
||||
SmaliExtendsList(EXTENDS_LIST)
|
||||
<empty list>
|
||||
SmaliImplementsList(IMPLEMENTS_LIST)
|
||||
<empty list>
|
||||
SmaliMethod(METHOD)
|
||||
SmaliThrowsList(THROWS_LIST)
|
||||
<empty list>
|
||||
PsiElement(METHOD_DIRECTIVE)('.method')
|
||||
PsiWhiteSpace(' ')
|
||||
SmaliModifierList(MODIFIER_LIST)
|
||||
<empty list>
|
||||
PsiElement(MEMBER_NAME)
|
||||
PsiElement(SIMPLE_NAME)('blah')
|
||||
SmaliMethodPrototype(METHOD_PROTOTYPE)
|
||||
PsiElement(OPEN_PAREN)('(')
|
||||
SmaliMethodParamList(METHOD_PARAM_LIST)
|
||||
<empty list>
|
||||
PsiElement(CLOSE_PAREN)(')')
|
||||
PsiElement(VOID_TYPE)
|
||||
PsiElement(VOID_TYPE)('V')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(REGISTERS_STATEMENT)
|
||||
PsiElement(REGISTERS_DIRECTIVE)('.registers')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LITERAL)
|
||||
PsiElement(POSITIVE_INTEGER_LITERAL)('1')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(INSTRUCTION)
|
||||
PsiElement(INSTRUCTION_FORMAT35c_METHOD)('invoke-virtual')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(OPEN_BRACE)('{')
|
||||
PsiElement(REGISTER_REFERENCE)
|
||||
PsiElement(REGISTER)('v0')
|
||||
PsiElement(CLOSE_BRACE)('}')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(METHOD_REFERENCE)
|
||||
PsiErrorElement:no viable alternative at input '.blah-'
|
||||
PsiElement(BAD_CHARACTER)('.blah-')
|
||||
PsiElement(BAD_CHARACTER)('>')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(MEMBER_NAME)
|
||||
<empty list>
|
||||
PsiElement(END_METHOD_DIRECTIVE)('.end method')
|
Loading…
x
Reference in New Issue
Block a user