From 0e110746d91d48c9a40440ab8807c5e6d23a3b1c Mon Sep 17 00:00:00 2001 From: zinc Date: Wed, 14 Oct 2026 15:54:17 +0330 Subject: unary: u*x, m*x, d*x are not recasts when the tag names a visible local (spec 1.6.3) --- src/compiler/expr.zc | 2 +- tests/conformance/known.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/expr.zc b/src/compiler/expr.zc index bcb92da..c0e9c91 100644 --- a/src/compiler/expr.zc +++ b/src/compiler/expr.zc @@ -1510,7 +1510,7 @@ int postfix_tail(int c) { // --, and any unary operator a program added (- ! ~ built in). int unary() { int c, un, t, place, constant, value; word storage, dependency; - if (tk == T_ID && (tv == s_u || tv == s_m || tv == s_d)) { // u*x, d*x, m*x: recast only when * is glued + if (tk == T_ID && (tv == s_u || tv == s_m || tv == s_d) && findloc(tv) < 0) { // u*x, d*x, m*x: recast only when * is glued and the tag is not a local's name peek(); if (pk_tk == T_OP && pk_tv == s_star && pq_gl[0]) { t = S_M; if (tv == s_u) t = S_U; if (tv == s_d) t = S_D; diff --git a/tests/conformance/known.txt b/tests/conformance/known.txt index 2412378..94d7869 100644 --- a/tests/conformance/known.txt +++ b/tests/conformance/known.txt @@ -1,6 +1,5 @@ # understood conformance failures: PATH IMPL CLASS reason # class a: self-hosted compiler bug; b: zc0 deviation (appendix a/b); c: spec issue to settle -1-source/ident_tags_as_variables_glued_star.zc zy a u*d with visible variables u and d is taken as a recast, not a multiplication (spec 1.6.3) 1-source/lit_bstr_cast_to_int_pointer.zc zy a the bstr flag leaks into an int* local, so p[0] reads a byte 2-types/typecheck_off_void_return_value_ok.zc zy a void f() { return 3; } yields 3, not 0 (spec 4.8.3) 3-expressions/call_24_parameters.zc zy a the parameter limit is 23, not 24 (decl.zc; closures 19) -- cgit v1.2.3