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

compiler: fix sizeof and cc

This commit is contained in:
BigBlack
2019-09-11 18:34:19 +08:00
committed by Alexander Medvednikov
parent 3588c3363d
commit e6354567e5
2 changed files with 7 additions and 10 deletions

View File

@@ -2348,11 +2348,7 @@ fn (p mut Parser) factor() string {
p.fgen('sizeof(')
p.next()
p.check(.lpar)
mut sizeof_typ := p.get_type()
if sizeof_typ.ends_with('*') {
// Move * from the end to the beginning, as C requires
sizeof_typ = '*' + sizeof_typ.left(sizeof_typ.len - 1)
}
mut sizeof_typ := p.get_type()
p.check(.rpar)
p.gen('$sizeof_typ)')
p.fgen('$sizeof_typ)')