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

checker: disallow address of array and map index outside unsafe (#6557)

This commit is contained in:
Swastik Baranwal
2020-10-05 16:38:30 +05:30
committed by GitHub
parent 2b1a5d7a56
commit 5f07b255bd
12 changed files with 54 additions and 25 deletions

View File

@@ -160,7 +160,9 @@ pub fn (d Dec32) get_string_32(neg bool, i_n_digit int, i_pad_digit int) string
x++
}
*/
return tos(byteptr(&buf[0]), i)
return unsafe {
tos(byteptr(&buf[0]), i)
}
}
fn f32_to_decimal_exact_int(i_mant u32, exp u32) (Dec32,bool) {

View File

@@ -190,7 +190,9 @@ fn (d Dec64) get_string_64(neg bool, i_n_digit int, i_pad_digit int) string {
x++
}
*/
return tos(byteptr(&buf[0]), i)
return unsafe {
tos(byteptr(&buf[0]), i)
}
}
fn f64_to_decimal_exact_int(i_mant u64, exp u64) (Dec64, bool) {