Phase 8.2.4: Slice fat pointer + bounds checking
- T[] slices are now fat pointers {data: T*, len: size_t} in C backend
- Added hSliceIndex HIR node for slice indexing (distinct from hIndexPtr for raw pointers)
- Added exprIndexBoundsCheck flag to AST ekIndex
- Sema sets bounds-check flag in @[Checked] functions
- C backend emits Slice_<T> typedefs and compound literals for slice init
- bux_bounds_check() called automatically on slice indexing in @[Checked] funcs
- Unchecked functions allow raw access (C behavior) for performance
This commit is contained in:
@@ -179,6 +179,7 @@ type
|
||||
of ekIndex:
|
||||
exprIndexObj*: Expr
|
||||
exprIndexIdx*: Expr
|
||||
exprIndexBoundsCheck*: bool
|
||||
of ekField:
|
||||
exprFieldObj*: Expr
|
||||
exprFieldName*: string
|
||||
|
||||
Reference in New Issue
Block a user