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

checker: ban unsafe pointer/fn comparison (#14462)

This commit is contained in:
Vincenzo Palazzo
2022-05-20 17:30:16 +02:00
committed by GitHub
parent d81fbb1ccd
commit 17bba712bd
28 changed files with 111 additions and 68 deletions

View File

@ -645,7 +645,7 @@ pub fn channel_select(mut channels []&Channel, dir []Direction, mut objrefs []vo
unsafe {
*subscr[i].prev = subscr[i].nxt
}
if subscr[i].nxt != 0 {
if unsafe { subscr[i].nxt != 0 } {
subscr[i].nxt.prev = subscr[i].prev
// just in case we have missed a semaphore during restore
subscr[i].nxt.sem.post()
@ -659,7 +659,7 @@ pub fn channel_select(mut channels []&Channel, dir []Direction, mut objrefs []vo
unsafe {
*subscr[i].prev = subscr[i].nxt
}
if subscr[i].nxt != 0 {
if unsafe { subscr[i].nxt != 0 } {
subscr[i].nxt.prev = subscr[i].prev
subscr[i].nxt.sem.post()
}