[vala/staging] vala: Don't create temp-variable for array concatenation expression



commit f8676a6584d5b67ac76e132061a9df5d92258b0f
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Mar 2 21:05:38 2020 +0100

    vala: Don't create temp-variable for array concatenation expression
    
    Found by scan-build

 vala/valaassignment.vala | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/vala/valaassignment.vala b/vala/valaassignment.vala
index 72f150314..abeca56dd 100644
--- a/vala/valaassignment.vala
+++ b/vala/valaassignment.vala
@@ -427,6 +427,8 @@ public class Vala.Assignment : Expression {
                if (binary != null && binary.left.value_type is ArrayType) {
                        if (binary.operator == BinaryOperator.PLUS) {
                                if (left.symbol_reference == binary.left.symbol_reference) {
+                                       // Allow direct access to array variable
+                                       binary.left.lvalue = true;
                                        return true;
                                }
                        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]