1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: make [live] fn unlock its mutex on early return

This commit is contained in:
Delyan Angelov
2020-01-14 19:58:46 +02:00
committed by Alexander Medvednikov
parent 26374971ab
commit 4838dda59a
6 changed files with 64 additions and 19 deletions

View File

@ -472,7 +472,7 @@ fn (v mut V) generate_init() {
}
')
}
if !v.pref.is_bare {
if !v.pref.is_bare && !v.pref.is_so {
// vlib can't have `init_consts()`
v.cgen.genln('void init() {
#if VPREALLOC
@ -581,7 +581,7 @@ pub fn (v mut V) generate_main() {
}
v.gen_main_end('return g_test_fails > 0')
}
else if v.table.main_exists() {
else if v.table.main_exists() && !v.pref.is_so {
v.gen_main_start(true)
cgen.genln(' main__main();')
if !v.pref.is_bare {