1
0
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:
Nick Treleaven
2020-07-03 17:10:10 +01:00
committed by GitHub
parent a2395ff3e8
commit 0b49e4db1c
13 changed files with 221 additions and 93 deletions

View File

@ -39,10 +39,10 @@ fn opt_ok2(data voidptr, mut option &OptionBase, size int) {
*option = OptionBase {
ok: true
}
}
// use ecode to get the end of OptionBase and then memcpy into it
C.memcpy(byteptr(&option.ecode) + sizeof(int), data, size)
// use ecode to get the end of OptionBase and then memcpy into it
C.memcpy(byteptr(&option.ecode) + sizeof(int), data, size)
}
}
// Old option type used for bootstrapping