cgen: fix `const x := opt() or {}` side effect interference with parallel cgen

pull/12522/head
Delyan Angelov 2021-11-19 18:15:06 +02:00
parent 762a7fde2a
commit e275220f05
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 2 additions and 1 deletions

View File

@ -6250,7 +6250,7 @@ fn (mut g Gen) write_init_function() {
g.writeln('\tvinit_string_literals();') g.writeln('\tvinit_string_literals();')
// //
for mod_name in g.table.modules { for mod_name in g.table.modules {
g.writeln('\t// Initializations for module $mod_name :') g.writeln('\t{ // Initializations for module $mod_name :')
g.write(g.inits[mod_name].str()) g.write(g.inits[mod_name].str())
g.write(g.global_inits[mod_name].str()) g.write(g.global_inits[mod_name].str())
init_fn_name := '${mod_name}.init' init_fn_name := '${mod_name}.init'
@ -6261,6 +6261,7 @@ fn (mut g Gen) write_init_function() {
g.writeln('\t${init_fn_c_name}();') g.writeln('\t${init_fn_c_name}();')
} }
} }
g.writeln('\t}')
} }
g.writeln('}') g.writeln('}')
if g.pref.printfn_list.len > 0 && '_vinit' in g.pref.printfn_list { if g.pref.printfn_list.len > 0 && '_vinit' in g.pref.printfn_list {