diff options
| author | 2026-10-15 02:40:12 +0330 | |
|---|---|---|
| committer | 2026-10-15 02:40:12 +0330 | |
| commit | 0970a68bcb9165aca8512ecd9ee9c0077abb9468 (patch) | |
| tree | 340714bee0b60a9b028924794573409b8e8b439b /docs | |
| parent | tests: zc0typed.zc drops the .u on a typed parameter, which zc0 rejects since... (diff) | |
compiler: a //:lines marker starts a new file, so unbounded; and unchecked; of the source before it end there: a program joined to the unbounded runtime in a self-hosted run-only image is bounds-checked again (since d55b5fd its index errors went unreported); runtime_image_test expects the trap's exit status 2; spec 4.15.1, 4.x unchecked, 5.15.3
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/SPEC.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/SPEC.md b/docs/SPEC.md index 7177b14..ed7822b 100644 --- a/docs/SPEC.md +++ b/docs/SPEC.md @@ -610,7 +610,7 @@ switch (s) { case circle(r): pn(r); case rect(w, h): pn(w * h); case dot: ps("do ### 4.9 unchecked -`unchecked stmt` runs the statement with the analyzer off (6.12). `unchecked;` at top level switches the analyzer off for the rest of the unit. `unchecked fn f() {}` makes one function unchecked. code in an unchecked block cannot touch a local that the analyzer tracks (error: x: is tracked by the analyzer and can't be used in unchecked code). +`unchecked stmt` runs the statement with the analyzer off (6.12). `unchecked;` at top level switches the analyzer off for the rest of the unit, or up to the next `//:lines` marker (5.15.3). `unchecked fn f() {}` makes one function unchecked. code in an unchecked block cannot touch a local that the analyzer tracks (error: x: is tracked by the analyzer and can't be used in unchecked code). ### 4.10 o3 @@ -663,7 +663,7 @@ int y = 7; asm { y @ 1 + y ! } // y is 8 ### 4.15 unbounded -4.15.1 `unbounded stmt` (a block or a single statement) compiles the statement without index bounds checks (3.7.4). `unbounded;` at top level does it for the rest of the unit. `unbounded fn f() {}` (also `unbounded T f(...)`, a method or a closure) makes one function unbounded; the prefix combines with `unchecked`, `immediate` and `o3` in any order. o3 code is unbounded. `unbounded` changes no result of a program whose indexes are in range. +4.15.1 `unbounded stmt` (a block or a single statement) compiles the statement without index bounds checks (3.7.4). `unbounded;` at top level does it for the rest of the unit, or up to the next `//:lines` marker (5.15.3), so a program joined to the unbounded runtime in a run-only image is checked. `unbounded fn f() {}` (also `unbounded T f(...)`, a method or a closure) makes one function unbounded; the prefix combines with `unchecked`, `immediate` and `o3` in any order. o3 code is unbounded. `unbounded` changes no result of a program whose indexes are in range. 4.15.2 the runtime, the core, the compiler, the language server, `run.zc` and `build.zc` are unbounded; std, icon and actor are checked except where a function reads headers on purpose. @@ -809,7 +809,7 @@ rt.put_n(util.twice(1)); // error: module access requires `include util;` 5.15.2 a line table changes no result of a program, only what a trace prints (8.4). a function compiled with lines off shows in a trace by its address and nearest name, or not at all when it belongs to the genome. -5.15.3 the comment `//:lines NAME` names the source after it NAME, counts its lines from the next line, and turns lines on from the next top-level item. +5.15.3 the comment `//:lines NAME` names the source after it NAME, counts its lines from the next line, and turns lines on from the next top-level item. it starts a new file: from the same item, `unbounded;` and `unchecked;` of the source before it no longer apply. ## 6. ownership and lifetimes |
