Hojun-Cho
b86b9d76e2
cgen: deref of *fn skips MOVQ load — pointer IS fn-addr ( #185 )
...
Pre-fix the N_UN TK_STAR arm applied the generic pointer-load
`MOVQ (AX), AX` to a *fn operand. cgexpr on the operand already
left AX = fn-addr (post-#180 LEAQ); the spurious second load
read the first instruction word, and the subsequent CALL AX
jumped through that junk address and segfaulted.
Cstage: cmd/w6c/cgen.c N_UN TK_STAR opens with a TY_NAMED-peel
+ TY_FN early-break — leave AX as the fn-addr cgexpr produced.
Wwstage twin in selfhost/cmd/wcc/cgenexpr.ww cgun TK_STAR walks
the n.type_ tinfo chain the same way (TY_NAMED peel then TY_FN
check) and returns before the generic load. Mirrors
ref/harec/src/check.c expr_call's STORAGE_POINTER→STORAGE_FUNCTION
path (harec skips the deref since the pointer IS the address).
Both stages must land together per rule-10 (cstage-only would
break 990-997 byte-id gates — same lesson as #180 ).
Probe: test/wcc/765_star_fn_deref.c, 5 rows table-driven —
minimal / branched-callee / alias-chain / fn-with-args /
fn-tuple-return. Every row is cstage-only via stage_mask
because wwstage's checker bails asserttyped on `(*f)(...)`
(filed as #181 — N_CALL type_ stamp gap on deref-call); #181 's
own probe will lock the wwstage runtime once the bail lifts.
Gate-blind risk (ken's note): byte-id alone cannot catch this
class because both stages drop the SAME instruction
symmetrically, so cs.s == ww.s holds either way. Runtime
exit-code is the only correctness net here.
Combined.ww regenerated for selfhost/cmd/{w6c,wwdump}/main.
combined.ww per #110 freshness gate.
2026-05-28 19:25:53 +09:00
..
2026-05-18 19:22:27 +09:00
2026-05-11 13:49:27 +09:00
2026-05-18 18:25:36 +09:00
2026-05-18 18:25:36 +09:00
2026-05-16 11:17:20 +09:00
2026-05-11 13:49:27 +09:00
2026-05-11 13:49:27 +09:00
2026-05-12 11:35:50 +09:00
2026-05-12 12:45:11 +09:00
2026-05-11 13:49:27 +09:00
2026-05-11 13:49:27 +09:00
2026-05-12 13:44:27 +09:00
2026-05-12 13:37:31 +09:00
2026-05-16 03:00:34 +09:00
2026-05-13 20:06:24 +09:00
2026-05-14 02:44:57 +09:00
2026-05-14 01:58:52 +09:00
2026-05-14 00:36:34 +09:00
2026-05-13 23:45:35 +09:00
2026-05-25 01:59:14 +09:00
2026-05-14 00:21:53 +09:00
2026-05-14 23:45:14 +09:00
2026-05-14 23:26:49 +09:00
2026-05-25 01:59:14 +09:00
2026-05-15 01:39:37 +09:00
2026-05-25 01:59:14 +09:00
2026-05-15 14:16:53 +09:00
2026-05-15 11:24:33 +09:00
2026-05-28 14:07:58 +09:00
2026-05-15 15:06:37 +09:00
2026-05-20 22:11:34 +09:00
2026-05-15 16:43:07 +09:00
2026-05-15 18:13:02 +09:00
2026-05-15 18:14:33 +09:00
2026-05-15 18:45:21 +09:00
2026-05-15 19:07:29 +09:00
2026-05-16 00:07:00 +09:00
2026-05-27 13:04:02 +09:00
2026-05-16 10:47:50 +09:00
2026-05-16 11:17:20 +09:00
2026-05-16 12:20:56 +09:00
2026-05-16 11:37:17 +09:00
2026-05-16 11:17:20 +09:00
2026-05-16 12:52:36 +09:00
2026-05-16 13:45:33 +09:00
2026-05-16 23:32:27 +09:00
2026-05-17 00:00:55 +09:00
2026-05-17 00:27:22 +09:00
2026-05-17 01:40:49 +09:00
2026-05-17 07:25:49 +09:00
2026-05-17 07:33:55 +09:00
2026-05-18 00:15:34 +09:00
2026-05-18 01:51:57 +09:00
2026-05-18 02:20:42 +09:00
2026-05-18 02:49:06 +09:00
2026-05-18 03:15:40 +09:00
2026-05-18 18:25:36 +09:00
2026-05-18 18:25:36 +09:00
2026-05-18 18:25:36 +09:00
2026-05-18 12:01:34 +09:00
2026-05-18 18:25:36 +09:00
2026-05-25 11:27:00 +09:00
2026-05-18 18:25:36 +09:00
2026-05-18 18:25:36 +09:00
2026-05-18 18:25:36 +09:00
2026-05-18 18:25:36 +09:00
2026-05-18 16:00:31 +09:00
2026-05-18 19:22:27 +09:00
2026-05-18 19:22:27 +09:00
2026-05-18 19:40:41 +09:00
2026-05-18 19:55:30 +09:00
2026-05-24 08:11:14 +09:00
2026-05-18 20:55:37 +09:00
2026-05-18 21:13:42 +09:00
2026-05-18 23:01:09 +09:00
2026-05-18 23:37:16 +09:00
2026-05-18 23:56:58 +09:00
2026-05-19 00:58:28 +09:00
2026-05-19 02:13:58 +09:00
2026-05-19 03:09:34 +09:00
2026-05-19 03:39:42 +09:00
2026-05-19 04:04:41 +09:00
2026-05-19 04:56:56 +09:00
2026-05-19 10:44:16 +09:00
2026-05-19 12:30:36 +09:00
2026-05-19 13:43:45 +09:00
2026-05-19 15:09:57 +09:00
2026-05-20 02:27:17 +09:00
2026-05-24 08:11:14 +09:00
2026-05-22 00:14:36 +09:00
2026-05-26 02:39:35 +09:00
2026-05-28 16:16:29 +09:00
2026-05-28 17:12:20 +09:00
2026-05-28 18:03:26 +09:00
2026-05-28 18:50:10 +09:00
2026-05-28 19:25:53 +09:00
2026-05-11 13:49:27 +09:00
2026-05-12 13:50:09 +09:00
2026-05-19 11:41:36 +09:00
2026-05-28 10:40:08 +09:00
2026-05-28 08:07:19 +09:00
2026-05-28 09:06:54 +09:00
2026-05-28 09:06:54 +09:00
2026-05-27 22:13:46 +09:00
2026-05-27 18:43:08 +09:00
2026-05-27 16:17:24 +09:00
2026-05-27 15:39:03 +09:00
2026-05-27 13:55:56 +09:00
2026-05-12 03:14:20 +09:00
2026-05-27 00:12:39 +09:00
2026-05-27 01:29:24 +09:00
2026-05-27 01:51:12 +09:00
2026-05-27 02:32:31 +09:00
2026-05-27 03:07:49 +09:00
2026-05-27 03:30:15 +09:00
2026-05-27 04:19:37 +09:00
2026-05-27 05:04:05 +09:00
2026-05-27 12:21:15 +09:00
2026-05-27 09:18:03 +09:00
2026-05-27 10:27:55 +09:00
2026-05-27 00:44:16 +09:00
2026-05-17 07:25:49 +09:00
2026-05-17 07:33:55 +09:00
2026-05-18 00:15:34 +09:00
2026-05-18 01:51:57 +09:00
2026-05-18 02:20:42 +09:00
2026-05-24 09:19:20 +09:00
2026-05-18 18:25:36 +09:00
2026-05-18 12:01:34 +09:00
2026-05-23 21:22:24 +09:00
2026-05-24 12:27:15 +09:00
2026-05-24 13:31:58 +09:00
2026-05-24 13:57:20 +09:00
2026-05-24 14:22:25 +09:00
2026-05-24 14:57:05 +09:00
2026-05-24 15:35:37 +09:00
2026-05-24 16:18:49 +09:00
2026-05-24 16:54:14 +09:00
2026-05-24 17:29:20 +09:00
2026-05-25 00:20:16 +09:00
2026-05-25 01:59:14 +09:00
2026-05-25 02:36:54 +09:00
2026-05-25 03:13:48 +09:00
2026-05-25 10:08:56 +09:00
2026-05-26 14:46:01 +09:00
2026-05-27 23:31:19 +09:00
2026-05-28 01:50:28 +09:00
2026-05-26 19:14:14 +09:00
2026-05-26 22:27:32 +09:00
2026-05-26 22:56:00 +09:00
2026-05-20 01:09:16 +09:00
2026-05-25 13:04:14 +09:00
2026-05-27 10:55:31 +09:00
2026-05-25 14:04:07 +09:00
2026-05-26 17:27:44 +09:00
2026-05-25 15:38:47 +09:00
2026-05-28 03:55:22 +09:00
2026-05-27 21:01:25 +09:00
2026-05-26 01:55:54 +09:00
2026-05-26 03:07:01 +09:00
2026-05-26 08:31:41 +09:00
2026-05-26 09:02:08 +09:00
2026-05-26 09:52:13 +09:00
2026-05-26 10:29:04 +09:00
2026-05-26 10:54:35 +09:00
2026-05-26 11:19:37 +09:00
2026-05-26 12:06:47 +09:00
2026-05-18 19:22:27 +09:00
2026-05-18 00:48:14 +09:00
2026-05-17 23:46:34 +09:00
2026-05-25 11:16:25 +09:00
2026-05-18 19:22:27 +09:00
2026-05-18 19:22:27 +09:00
2026-05-18 19:22:27 +09:00
2026-05-15 15:48:13 +09:00
2026-05-15 17:13:32 +09:00
2026-05-15 17:14:49 +09:00
2026-05-16 02:42:41 +09:00
2026-05-17 02:51:15 +09:00
2026-05-17 02:40:40 +09:00
2026-05-17 07:07:57 +09:00
2026-05-15 00:26:10 +09:00
2026-05-15 00:27:38 +09:00
2026-05-18 19:22:27 +09:00
2026-05-15 09:00:34 +09:00
2026-05-15 09:00:34 +09:00
2026-05-15 09:00:34 +09:00
2026-05-15 09:00:34 +09:00
2026-05-15 09:00:34 +09:00
2026-05-15 09:00:34 +09:00
2026-05-15 09:00:34 +09:00
2026-05-28 09:55:45 +09:00
2026-05-21 16:32:27 +09:00
2026-05-21 16:32:27 +09:00
2026-05-21 16:32:27 +09:00
2026-05-21 16:32:27 +09:00
2026-05-21 18:07:13 +09:00
2026-05-11 17:52:29 +09:00
2026-05-12 03:58:55 +09:00
2026-05-14 02:51:49 +09:00
2026-05-15 09:00:34 +09:00