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:
committed by
Alexander Medvednikov
parent
3588c3363d
commit
e6354567e5
@@ -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)')
|
||||
|
||||
Reference in New Issue
Block a user