Преглед на файлове

feat(express): verify proc3 exact (PopOperand, chained +4 arithmetic)

Eric Streit преди 2 седмици
родител
ревизия
ffae8d63b0
променени са 1 файла, в които са добавени 10 реда и са изтрити 1 реда
  1. 10 1
      src/compiler/EXPRESS.MOD

+ 10 - 1
src/compiler/EXPRESS.MOD

@@ -119,8 +119,17 @@ BEGIN
     END;
   END;
 END PushOperand;
+(* proc3 @01c3 — ~PopOperand: emit pending-op form of descriptor. *)
 PROCEDURE PopOperand(d: HeadPtr);
-BEGIN HALT; END PopOperand;
+BEGIN
+  IF d^.typ^.w4 > 9 THEN
+    LoadIndirect(d^);
+    CodeGen.EmitStandardOp(17);
+  ELSE
+    CodeGen.SetPendingOp((CARDINAL(d^.typ^.w3) DIV 2) - ORD(RecordPtr(d^.typ) = Compiler.LongrealType) + 4,
+      d^.kind, CARDINAL(d^.value), d^.extra);
+  END;
+END PopOperand;
 (* proc25 @000c — option-12 guard. *)
 PROCEDURE GetRangeBase(v: ADDRESS);
 BEGIN