mirror of
https://github.com/revanced/smali.git
synced 2025-05-30 20:40:11 +02:00
Move the totalMethodRegisters calculation back up to when the rule is matched, because the value is needed for subsequent rules
git-svn-id: https://smali.googlecode.com/svn/trunk@720 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
4d9801a89d
commit
cafef597c9
@ -487,7 +487,15 @@ method returns[ ClassDataItem.EncodedMethod encodedMethod,
|
|||||||
methodParameterRegisters++;
|
methodParameterRegisters++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
registers_directive?
|
( registers_directive
|
||||||
|
{
|
||||||
|
if ($registers_directive.isLocalsDirective) {
|
||||||
|
totalMethodRegisters = $registers_directive.registers + methodParameterRegisters;
|
||||||
|
} else {
|
||||||
|
totalMethodRegisters = $registers_directive.registers;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)?
|
||||||
labels
|
labels
|
||||||
packed_switch_declarations
|
packed_switch_declarations
|
||||||
sparse_switch_declarations
|
sparse_switch_declarations
|
||||||
@ -560,12 +568,6 @@ method returns[ ClassDataItem.EncodedMethod encodedMethod,
|
|||||||
throw new SemanticException(input, $I_METHOD, "A .registers or .locals directive must be present for a non-abstract/non-final method");
|
throw new SemanticException(input, $I_METHOD, "A .registers or .locals directive must be present for a non-abstract/non-final method");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($registers_directive.isLocalsDirective) {
|
|
||||||
totalMethodRegisters = $registers_directive.registers + methodParameterRegisters;
|
|
||||||
} else {
|
|
||||||
totalMethodRegisters = $registers_directive.registers;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (totalMethodRegisters < methodParameterRegisters) {
|
if (totalMethodRegisters < methodParameterRegisters) {
|
||||||
throw new SemanticException(input, $registers_directive.start, "This method requires at least " +
|
throw new SemanticException(input, $registers_directive.start, "This method requires at least " +
|
||||||
Integer.toString(methodParameterRegisters) +
|
Integer.toString(methodParameterRegisters) +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user