From e06185e56d3b9cdb6d959b878ed7aef7afa48cc8 Mon Sep 17 00:00:00 2001 From: Minero Aoki Date: Fri, 8 May 2009 10:41:00 +0000 Subject: [PATCH] r4756@macbookpro: aamine | 2009-05-07 11:06:57 +0900 * net/loveruby/cflat/compiler/IRGenerator.java (BinaryOpNode): evaluate RIGHT before LEFT. git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4189 1b9489fe-b721-0410-924e-b54b9192deb8 --- ChangeLog | 5 +++++ net/loveruby/cflat/compiler/IRGenerator.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 032df99..e63cae3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu May 7 11:06:48 2009 Minero Aoki + + * net/loveruby/cflat/compiler/IRGenerator.java (BinaryOpNode): + evaluate RIGHT before LEFT. + Thu May 7 10:31:12 2009 Minero Aoki * net/loveruby/cflat/compiler/IRGenerator.java: fix compile error. diff --git a/net/loveruby/cflat/compiler/IRGenerator.java b/net/loveruby/cflat/compiler/IRGenerator.java index 68b7717..59c7a7c 100644 --- a/net/loveruby/cflat/compiler/IRGenerator.java +++ b/net/loveruby/cflat/compiler/IRGenerator.java @@ -567,8 +567,8 @@ class IRGenerator implements ASTVisitor { // #@@range/BinaryOp{ public Expr visit(BinaryOpNode node) { - Expr left = transformExpr(node.left()); Expr right = transformExpr(node.right()); + Expr left = transformExpr(node.left()); if (node.operator().equals("+") || node.operator().equals("-")) { if (node.left().type().isDereferable()) { right = new Bin(ptrDiffType(), Op.MUL,