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

pref,cgen: support -no-bounds-checking, instead of -d no_bounds_checking, and make it enable direct_array_access for all fns/methods.

This commit is contained in:
Delyan Angelov
2022-10-30 14:06:07 +02:00
parent 54b623743d
commit 9edb48571f
8 changed files with 59 additions and 43 deletions

View File

@@ -611,7 +611,7 @@ pub fn memdup_uncollectable(src voidptr, sz int) voidptr {
[inline]
fn v_fixed_index(i int, len int) int {
$if !no_bounds_checking ? {
$if !no_bounds_checking {
if i < 0 || i >= len {
s := 'fixed array index out of range (index: $i, len: $len)'
panic(s)