diff --git a/selfhost/cmd/w6c/main.combined.ww b/selfhost/cmd/w6c/main.combined.ww index dae51232..b2e28622 100644 --- a/selfhost/cmd/w6c/main.combined.ww +++ b/selfhost/cmd/w6c/main.combined.ww @@ -12952,12 +12952,13 @@ fn rhstaggedabicall(c: *cgen, src: *node) bool = { }; // N_DOT of a tagged-typed struct field — cgdot loads // AX=tag, DX=word0, CX=word1[, R8=word2], so downstream - // spill matches the call/index shapes. + // spill matches the call/index shapes. #58 A.6.3i-phase-2: + // read the checker-stamped n.type_ (check.ww N_DOT struct-field + // stamp) instead of re-deriving via dotfieldtnode — matches + // cstage cg_widen_tagged_store reading src->type directly + // (cmd/w6c/cgen.c:1302-1305). typeistagged(nil) is false. if (src.kind == nkind.N_DOT) { - let ft: *node = dotfieldtnode(c, src); - if (ft != nil) { - if (istaggedtype(c, ft)) { return true; }; - }; + if (typeistagged(src.type_: *tinfo)) { return true; }; }; return false; }; diff --git a/selfhost/cmd/wcc/cgenutil.ww b/selfhost/cmd/wcc/cgenutil.ww index 1e0f7e75..debc152d 100644 --- a/selfhost/cmd/wcc/cgenutil.ww +++ b/selfhost/cmd/wcc/cgenutil.ww @@ -2511,12 +2511,13 @@ fn rhstaggedabicall(c: *cgen, src: *node) bool = { }; // N_DOT of a tagged-typed struct field — cgdot loads // AX=tag, DX=word0, CX=word1[, R8=word2], so downstream - // spill matches the call/index shapes. + // spill matches the call/index shapes. #58 A.6.3i-phase-2: + // read the checker-stamped n.type_ (check.ww N_DOT struct-field + // stamp) instead of re-deriving via dotfieldtnode — matches + // cstage cg_widen_tagged_store reading src->type directly + // (cmd/w6c/cgen.c:1302-1305). typeistagged(nil) is false. if (src.kind == nkind.N_DOT) { - let ft: *node = dotfieldtnode(c, src); - if (ft != nil) { - if (istaggedtype(c, ft)) { return true; }; - }; + if (typeistagged(src.type_: *tinfo)) { return true; }; }; return false; }; diff --git a/selfhost/cmd/wwdump/main.combined.ww b/selfhost/cmd/wwdump/main.combined.ww index d76f17e9..f433b852 100644 --- a/selfhost/cmd/wwdump/main.combined.ww +++ b/selfhost/cmd/wwdump/main.combined.ww @@ -12952,12 +12952,13 @@ fn rhstaggedabicall(c: *cgen, src: *node) bool = { }; // N_DOT of a tagged-typed struct field — cgdot loads // AX=tag, DX=word0, CX=word1[, R8=word2], so downstream - // spill matches the call/index shapes. + // spill matches the call/index shapes. #58 A.6.3i-phase-2: + // read the checker-stamped n.type_ (check.ww N_DOT struct-field + // stamp) instead of re-deriving via dotfieldtnode — matches + // cstage cg_widen_tagged_store reading src->type directly + // (cmd/w6c/cgen.c:1302-1305). typeistagged(nil) is false. if (src.kind == nkind.N_DOT) { - let ft: *node = dotfieldtnode(c, src); - if (ft != nil) { - if (istaggedtype(c, ft)) { return true; }; - }; + if (typeistagged(src.type_: *tinfo)) { return true; }; }; return false; };