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

all: disallow pointer arithmetic for AssignStmt, PostfixExpr outside unsafe{} (#5581)

This commit is contained in:
Nick Treleaven
2020-07-01 13:50:17 +01:00
committed by GitHub
parent 5eb76606ae
commit e7339fec15
6 changed files with 68 additions and 33 deletions

View File

@ -137,7 +137,9 @@ pub fn malloc(n int) byteptr {
}
$if prealloc {
res := g_m2_ptr
g_m2_ptr += n
unsafe {
g_m2_ptr += n
}
nr_mallocs++
return res
} $else {