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

builtin,crypto: fix problems detected by -fsanitize=address,undefined and -fsanitize=memory

This commit is contained in:
Delyan Angelov
2021-11-28 20:35:18 +02:00
parent b4c52b72cf
commit 31fe02de8c
5 changed files with 28 additions and 19 deletions

View File

@ -506,7 +506,8 @@ pub fn (a &array) free() {
// if a.is_slice {
// return
// }
unsafe { free(&byte(a.data) - a.offset) }
mblock_ptr := &byte(u64(a.data) - u64(a.offset))
unsafe { free(mblock_ptr) }
}
// filter creates a new array with all elements that pass the test implemented by the provided function