mirror of https://github.com/aamine/cbc
* 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:
parent
556d917fff
commit
81bbba45af
|
@ -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
|
||||
|
|
|
@ -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"));
|
||||
|
|
Loading…
Reference in New Issue