Commit e3cccfb7 authored by Luca Bruno's avatar Luca Bruno

Fix subtle bug in flowanalyzer that made the compiler crash

By not copying the datatype the parent_node was overwritten.
The bug was reproducible only with G_SLICE=always-malloc .
parent 4d3b6967
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment