From 39857ceb4ece09eb739fe17895ec807e3e04f602 Mon Sep 17 00:00:00 2001 From: zinc Date: Wed, 14 Oct 2026 15:55:01 +0330 Subject: casts: a cast clears the byte-string flag unless the type is bstr, so (int*)s indexes words --- src/compiler/expr.zc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/compiler/expr.zc') diff --git a/src/compiler/expr.zc b/src/compiler/expr.zc index c0e9c91..3829ecf 100644 --- a/src/compiler/expr.zc +++ b/src/compiler/expr.zc @@ -1534,6 +1534,7 @@ int unary() { else if (xfloat && isnum(t)) { op(OP_F2I); xfloat = 0; } else xfloat = 0; if (tbytes(t) && !samesz(t, xty)) { tnorm(t); xconst = 0; } // (u8)x cuts the value to size + xstr = t == tbstr; // (int*)s is a word pointer, not a byte string if_value = 0; xty = t; lv = 0; lvk = LV_NONE; xzero = 0; xbor = -1; return C_PLAIN; -- cgit v1.2.3