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

checker: check unsafe V function calls (#8752)

This commit is contained in:
Nick Treleaven
2021-02-14 18:31:42 +00:00
committed by GitHub
parent d3bcd5d305
commit ea803113c3
36 changed files with 200 additions and 161 deletions

View File

@@ -111,7 +111,7 @@ pub fn new_channel<T>(n u32) &Channel {
fn new_channel_st(n u32, st u32) &Channel {
wsem := if n > 0 { n } else { 1 }
rsem := if n > 0 { u32(0) } else { 1 }
rbuf := if n > 0 { malloc(int(n * st)) } else { byteptr(0) }
rbuf := if n > 0 { unsafe {malloc(int(n * st))} } else { byteptr(0) }
sbuf := if n > 0 { vcalloc(int(n * 2)) } else { byteptr(0) }
mut ch := &Channel{
objsize: st