]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix subtle bug in flowanalyzer that made the compiler crash
authorLuca Bruno <lucabru@src.gnome.org>
Wed, 2 Oct 2013 20:11:46 +0000 (22:11 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Wed, 2 Oct 2013 20:12:58 +0000 (22:12 +0200)
By not copying the datatype the parent_node was overwritten.
The bug was reproducible only with G_SLICE=always-malloc .

vala/valaflowanalyzer.vala

index 45283377d36cdbfc371ede69c3aa9b6fb96fd050..62dc58a7308017a1bd12e7a78ab92cdb31e080a1 100644 (file)
@@ -514,10 +514,10 @@ public class Vala.FlowAnalyzer : CodeVisitor {
                }
                Variable versioned_var;
                if (var_symbol is LocalVariable) {
-                       versioned_var = new LocalVariable (var_symbol.variable_type, var_symbol.name, null, var_symbol.source_reference);
+                       versioned_var = new LocalVariable (var_symbol.variable_type.copy (), var_symbol.name, null, var_symbol.source_reference);
                } else {
                        // parameter
-                       versioned_var = new Parameter (var_symbol.name, var_symbol.variable_type, var_symbol.source_reference);
+                       versioned_var = new Parameter (var_symbol.name, var_symbol.variable_type.copy (), var_symbol.source_reference);
                }
                variable_stack.add (versioned_var);
                return versioned_var;