diff --git a/compiler/depgraph.v b/compiler/depgraph.v index 51c060cf9c..05900ff7d7 100644 --- a/compiler/depgraph.v +++ b/compiler/depgraph.v @@ -54,7 +54,7 @@ pub fn new_dep_graph() &DepGraph { pub fn(graph mut DepGraph) add(mod string, deps []string) { graph.nodes << DepGraphNode{ name: mod, - deps: deps + deps: deps.clone() } } diff --git a/compiler/parser.v b/compiler/parser.v index 8892a4d42a..39551911d6 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -695,7 +695,7 @@ fn (p mut Parser) enum_decl(_enum_name string) { mod: p.mod parent: 'int' cat: TypeCategory.enum_ - enum_vals: fields + enum_vals: fields.clone() }) p.check(.rcbr) p.fgenln('\n') @@ -1056,12 +1056,12 @@ fn (p mut Parser) close_scope() { // println('breaking. "$v.name" v.scope_level=$v.scope_level') break } - if false && !p.building_v && !v.is_mut && v.is_alloc { + if p.building_v && v.is_alloc { if v.typ.starts_with('array_') { p.genln('v_array_free($v.name); // close_scope free') } else if v.typ == 'string' { - p.genln('v_string_free($v.name); // close_scope free') + //p.genln('v_string_free($v.name); // close_scope free') } else if v.ptr { //p.genln('free($v.name); // close_scope free')