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:
2026-06-01 11:50:45 +03:00
parent bf9e73d56e
commit cefd2a8442
6 changed files with 85 additions and 24 deletions
+1
View File
@@ -179,6 +179,7 @@ type
of ekIndex:
exprIndexObj*: Expr
exprIndexIdx*: Expr
exprIndexBoundsCheck*: bool
of ekField:
exprFieldObj*: Expr
exprFieldName*: string