checker: disallow struct int to ptr outside unsafe (#17923)

This commit is contained in:
Swastik Baranwal 2023-04-13 11:08:21 +05:30 committed by GitHub
parent 92cb7468ce
commit 3d99f1f2c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 124 additions and 47 deletions

View file

@ -1355,7 +1355,7 @@ fn (mut dl Dlmalloc) segment_holding(ptr voidptr) &Segment {
}
sp = sp.next
}
return &Segment(0)
return &Segment(unsafe { nil })
}
// realloc behaves as libc realloc, but operates within the given space