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

compiler: no free on stack allocated array

This commit is contained in:
Henrixounez 2019-09-14 12:40:59 +02:00 committed by Alexander Medvednikov
parent d340dd79b8
commit c604a5c02f

View File

@ -2760,6 +2760,7 @@ fn (p mut Parser) array_init() string {
if p.table.known_type(array_elem_typ) {
p.cgen.resetln('')
p.gen('{0}')
p.is_alloc = false
if is_const_len {
return '[${p.mod}__$lit]$array_elem_typ'
}