From cde5ef884ad99b2f32549e8247dcfdc76763c820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=A2=93=E9=BA=9F?= Date: Thu, 25 Aug 2016 21:50:27 +0800 Subject: [PATCH] fix VariableNode constant entity bug --- net/loveruby/cflat/ast/VariableNode.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/net/loveruby/cflat/ast/VariableNode.java b/net/loveruby/cflat/ast/VariableNode.java index 7ab3c9f..bdda399 100644 --- a/net/loveruby/cflat/ast/VariableNode.java +++ b/net/loveruby/cflat/ast/VariableNode.java @@ -37,6 +37,24 @@ public class VariableNode extends LHSNode { entity = ent; } + /*============================================== + = fix constant entity bug = + ==============================================*/ + public boolean isLvalue() { + if (entity.isConstant()) { + return false; + } + return true; + } + + public boolean isAssignable() { + if (entity.isConstant()) { + return false; + } + return isLoadable(); + } + /*===== End of fix constant entity bug ======*/ + public TypeNode typeNode() { return entity().typeNode(); }