Selaa lähdekoodia

feat(express): verify proc6/22; CheckAndStore is typ:=NodePtr(typ^.w2), nested IF

Eric Streit 2 viikkoa sitten
vanhempi
commit
ffeeb4de47
2 muutettua tiedostoa jossa 17 lisäystä ja 5 poistoa
  1. 5 0
      SESSION.md
  2. 12 5
      src/compiler/EXPRESS.MOD

+ 5 - 0
SESSION.md

@@ -288,3 +288,8 @@ Next: GENZ80 media hunt; stage-2 pty-driven MCD diff per module.
   (not VAR); VAR-ADDRESS accepts pointer vars/fields (not CARDINAL).
   Value-record params pass by reference (single push) but copy on entry
   (reserve_string) so not for no-copy procs. Transfers from records banned.
+- Verified now 23: + proc6 Proc6 (13/13, trailing ZZ gap-junk only),
+  proc22 CheckAndStore (18/18). Shape: nested IF (jpfalse, not andjp);
+  store is `d^.typ := NodePtr(d^.typ^.w2)` (5-push: d,d,typ,w2,store —
+  direct unwrap, NO T1 call, zero-cost transfer). Scorer PREFIX(+n) with
+  trailing gap-junk = SAME body (verify by byte list, not label).

+ 12 - 5
src/compiler/EXPRESS.MOD

@@ -173,10 +173,17 @@ BEGIN
     END;
   END;
 END EmitAddress;
-(* proc22 stub — ~CheckAndStore (VALUE ADDRESS: proc20 passes ADR(sel),
-   proc15 passes curDesc pointer; TBD by MCD audit). *)
-PROCEDURE CheckAndStore(a: ADDRESS);
-BEGIN HALT; END CheckAndStore;
+(* proc22 @0057 — ~CheckAndStore: unwrap typ to typ^.w2 when kind=6 and
+   w2 nonzero (nested IF for jpfalse shape; store is d^.typ := NodePtr(w2),
+   zero-cost transfer, no call). *)
+PROCEDURE CheckAndStore(d: HeadPtr);
+BEGIN
+  IF d^.typ^.w4 = 6 THEN
+    IF CARDINAL(d^.typ^.w2) <> 0 THEN
+      d^.typ := NodePtr(d^.typ^.w2);
+    END;
+  END;
+END CheckAndStore;
 
 PROCEDURE PushExprDesc(dst: HeadPtr; src: DescPtr);
 VAR aligned: CARDINAL; (* local word-2 *)
@@ -470,7 +477,7 @@ BEGIN
   CentralError(sel = curDesc^.typ, 64);
   END;
   ELSE (*{0659}*) (* not-found path *)
-  CheckAndStore(sel);
+  CheckAndStore(HeadPtr(sel));
   IF needVal THEN
     CentralError((sel = t)
                  OR ((RecordPtr(sel) = Compiler.AddressType) AND (t^.w4 = 5))