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

checker: allow *x = y only inside unsafe blocks

This commit is contained in:
Alexander Medvednikov
2020-05-11 16:05:59 +02:00
parent 2618b4fbd3
commit e9177faf17
4 changed files with 32 additions and 12 deletions

View File

@ -18,6 +18,8 @@ pub fn next(max int) int {
// writes a result value to the seed argument.
pub fn rand_r(seed &int) int {
ns := *seed * 1103515245 + 12345
(*seed) = ns
unsafe {
(*seed) = ns
}
return ns & 0x7fffffff
}