cgen: default the hi bound of a slice/str-field slice, both stages

x.slicefield[:] / x.strfield[2:] emitted MOVQ $0 for the omitted hi
bound on BOTH stages (N_IDENT-gated dispatch; symmetric, so byte
identity never caught it) in all four sites: cgexpr N_SLICE + pushargs
(cstage), cgslice + pushargsrev (wwstage). The new arm re-evaluates
the pure field read for its {ptr,len,cap} header and takes .len,
covering local, viaptr, dot-chain, (*p), arr[i], and global inners.
Call inners still loud-reject upstream. Sibling of the #252/#257
array-field arms.
This commit is contained in:
2026-08-08 00:29:51 +09:00
parent cc22abfc04
commit 66251cc52b
7 changed files with 190 additions and 6 deletions

View File

@@ -1,13 +1,13 @@
package wwfixture;
def protocolversion: i32 = 1;
def corpuscount: i32 = 1230;
def corpuscount: i32 = 1233;
def errorcount: i32 = 314;
def compilecount: i32 = 12;
def runcount: i32 = 138;
def runcount: i32 = 141;
def runexitcount: i32 = 766;
def nativecount: i32 = 2460;
def corpushash: str = "fd04059b05a19ae63f1bec3edaefedf1d8ce9a505302a153434457d0fb9b9eca";
def nativecount: i32 = 2466;
def corpushash: str = "65d3642dfb77b486f5aed23044a979bbce37c36fbbcb7a7aedae20d87c7b0e4f";
type directive = enum i32 {
ERROR = 0,