mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-06-09 18:29:36 +00:00
- Fixed an issue where __zp without specifying the number would cause a crash.
This commit is contained in:
parent
d75d96473c
commit
dcbf2a4efe
|
@ -471,7 +471,7 @@ public class VariableBuilder {
|
|||
}
|
||||
|
||||
Directive.MemZp zpDirective = findDirective(Directive.MemZp.class, directives);
|
||||
if(zpDirective != null) {
|
||||
if(zpDirective != null && zpDirective.zp != null) {
|
||||
return new Registers.RegisterZpMem(zpDirective.zp, -1, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -1532,9 +1532,9 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
|||
|
||||
@Override
|
||||
public Directive visitDirectiveMemoryAreaZp(KickCParser.DirectiveMemoryAreaZpContext ctx) {
|
||||
String zpText = ctx.NUMBER().getText();
|
||||
if(zpText != null)
|
||||
if(ctx.NUMBER() != null)
|
||||
try {
|
||||
String zpText = ctx.NUMBER().getText();
|
||||
Number zpNumber = NumberParser.parseLiteral(zpText);
|
||||
return new Directive.MemZp(zpNumber.intValue());
|
||||
} catch(NumberFormatException e) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user