mirror of
https://github.com/revanced/smali.git
synced 2025-06-12 12:17:37 +02:00
Improve parsing of an invalid SmaliMethod with no .end method
This ensures that we still generate a SmaliMethod in this case, instead of erroring out when not matching the END_METHOD_DIRECTIVE and aborting the main SmaliMethod mark.
This commit is contained in:
4
smalidea/testData/InvalidMethod.smalidea
Normal file
4
smalidea/testData/InvalidMethod.smalidea
Normal file
@ -0,0 +1,4 @@
|
||||
.class Ltest;
|
||||
.super Ljava/lang/Object;
|
||||
|
||||
.method .blah
|
33
smalidea/testData/InvalidMethod.txt
Normal file
33
smalidea/testData/InvalidMethod.txt
Normal file
@ -0,0 +1,33 @@
|
||||
smali.FILE
|
||||
SmaliClass(CLASS)
|
||||
SmaliModifierList(MODIFIER_LIST)
|
||||
<empty list>
|
||||
SmaliExtendsList(EXTENDS_LIST)
|
||||
<empty list>
|
||||
SmaliImplementsList(IMPLEMENTS_LIST)
|
||||
<empty list>
|
||||
PsiElement(CLASS_STATEMENT)
|
||||
PsiElement(CLASS_DIRECTIVE)('.class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(ACCESS_LIST)
|
||||
<empty list>
|
||||
PsiElement(CLASS_TYPE)
|
||||
PsiElement(CLASS_DESCRIPTOR)('Ltest;')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(SUPER_STATEMENT)
|
||||
PsiElement(SUPER_DIRECTIVE)('.super')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(CLASS_TYPE)
|
||||
PsiElement(CLASS_DESCRIPTOR)('Ljava/lang/Object;')
|
||||
PsiWhiteSpace('\n\n')
|
||||
SmaliMethod(METHOD)
|
||||
SmaliModifierList(MODIFIER_LIST)
|
||||
<empty list>
|
||||
PsiElement(METHOD_DIRECTIVE)('.method')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(ACCESS_LIST)
|
||||
<empty list>
|
||||
PsiErrorElement:no viable alternative at input '.blah'
|
||||
PsiElement(BAD_CHARACTER)('.blah')
|
||||
SmaliMethodPrototype(METHOD_PROTOTYPE)
|
||||
<empty list>
|
Reference in New Issue
Block a user