mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v/checker.v: disallow pointer arithmetic for InfixExpr outside unsafe {} (#5640)
This commit is contained in:
@ -48,7 +48,9 @@ fn new_sorted_map(n, value_bytes int) SortedMap { // TODO: Remove `n`
|
||||
fn new_sorted_map_init(n, value_bytes int, keys &string, values voidptr) SortedMap {
|
||||
mut out := new_sorted_map(n, value_bytes)
|
||||
for i in 0 .. n {
|
||||
out.set(keys[i], byteptr(values) + i * value_bytes)
|
||||
unsafe {
|
||||
out.set(keys[i], byteptr(values) + i * value_bytes)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
Reference in New Issue
Block a user