summaryrefslogtreecommitdiff
path: root/vala/valaassignment.vala
diff options
context:
space:
mode:
authorLuca Bruno <lucabru@src.gnome.org>2011-07-01 18:49:59 +0200
committerLuca Bruno <lucabru@src.gnome.org>2011-07-06 22:32:28 +0200
commit851b2802354ead100cfe366101be597dbb13e1f1 (patch)
tree1d1881f7c402ef796342d77aad7448c5d3df22aa /vala/valaassignment.vala
parent72bc9bd3b79156db12c4192afa303c7597ac8d75 (diff)
downloadvala-851b2802354ead100cfe366101be597dbb13e1f1.tar.gz
Don't set target_value of assignment if parent is an expression statement
Diffstat (limited to 'vala/valaassignment.vala')
-rw-r--r--vala/valaassignment.vala20
1 files changed, 11 insertions, 9 deletions
diff --git a/vala/valaassignment.vala b/vala/valaassignment.vala
index c7af099af..3b8857a11 100644
--- a/vala/valaassignment.vala
+++ b/vala/valaassignment.vala
@@ -489,15 +489,17 @@ public class Vala.Assignment : Expression {
codegen.store_field (field, instance && ma.inner != null ? ma.inner.target_value : null, new_value);
}
- // when load_variable is changed to use temporary
- // variables, replace following code with this line
- // target_value = new_value;
- if (local != null) {
- target_value = codegen.load_local (local);
- } else if (param != null) {
- target_value = codegen.load_parameter (param);
- } else if (field != null) {
- target_value = codegen.load_field (field, instance && ma.inner != null ? ma.inner.target_value : null);
+ if (!(parent_node is ExpressionStatement)) {
+ // when load_variable is changed to use temporary
+ // variables, replace following code with this line
+ // target_value = new_value;
+ if (local != null) {
+ target_value = codegen.load_local (local);
+ } else if (param != null) {
+ target_value = codegen.load_parameter (param);
+ } else if (field != null) {
+ target_value = codegen.load_field (field, instance && ma.inner != null ? ma.inner.target_value : null);
+ }
}
codegen.visit_expression (this);