diff --git a/ChangeLog b/ChangeLog index d27f23c..ecbb9ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Sep 21 17:22:45 2008 Minero Aoki + + * net/loveruby/cflat/compiler/CodeGenerator.java: lhs.memref may + be null when lhs is extern variable. + Sun Sep 21 05:43:28 2008 Minero Aoki * net/loveruby/cflat/compiler/CodeGenerator.java: optimize diff --git a/net/loveruby/cflat/compiler/CodeGenerator.java b/net/loveruby/cflat/compiler/CodeGenerator.java index 1c6142c..f9099db 100644 --- a/net/loveruby/cflat/compiler/CodeGenerator.java +++ b/net/loveruby/cflat/compiler/CodeGenerator.java @@ -860,7 +860,7 @@ public class CodeGenerator extends Visitor implements ASTLHSVisitor { // public void visit(AssignNode node) { - if (node.lhs().isConstantAddress()) { + if (node.lhs().isConstantAddress() && node.lhs().memref() != null) { compile(node.rhs()); save(node.type(), reg("ax"), node.lhs().memref()); } @@ -881,7 +881,7 @@ public class CodeGenerator extends Visitor implements ASTLHSVisitor { } public void visit(OpAssignNode node) { - if (node.lhs().isConstantAddress()) { + if (node.lhs().isConstantAddress() && node.lhs().memref() != null) { // const += ANY compile(node.rhs()); mov(reg("ax"), reg("cx"));