* net/loveruby/cflat/compiler/CodeGenerator.java: lhs.memref may be null when lhs is extern variable.

git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4042 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
Minero Aoki 2008-09-21 08:22:48 +00:00
parent 556d917fff
commit 81bbba45af
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Sun Sep 21 17:22:45 2008 Minero Aoki <aamine@loveruby.net>
* 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 <aamine@loveruby.net>
* net/loveruby/cflat/compiler/CodeGenerator.java: optimize

View File

@ -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"));