瀏覽代碼

feat(express): verify proc7/8/9 exact; ConstToCard whole-c (no word0 deref)

Eric Streit 2 周之前
父節點
當前提交
a527357c38
共有 1 個文件被更改,包括 3 次插入 和 3 次删除
  1. 3 3
      src/compiler/EXPRESS.MOD

+ 3 - 3
src/compiler/EXPRESS.MOD

@@ -305,13 +305,13 @@ END FoldConstOp;
 PROCEDURE ConstToCard(c: RecordPtr; errPos: CARDINAL);
 BEGIN
   (*{04cd}*)
-  IF ((c^.word0 <> Compiler.IntType) AND (c^.word4 <> 1))
+  IF ((c <> Compiler.IntType) AND (c^.word4 <> 1))
      OR (c^.word2 <> Compiler.IntType)
      OR (curDesc^.mode <> 0)
      OR (RecordPtr(curDesc^.typ) <> Compiler.CardType)
      OR (INTEGER(curDesc^.value) < 0) THEN
-    IF NOT IsSet(c^.word0, RecordPtr(curDesc^.typ)) THEN
-      Errors.ReportAssignMismatch(SymTab.T1(c^.word0), SymTab.T1(curDesc^.typ), errPos);
+    IF NOT IsSet(c, RecordPtr(curDesc^.typ)) THEN
+      Errors.ReportAssignMismatch(SymTab.T1(c), SymTab.T1(curDesc^.typ), errPos);
     END;
   END;
 END ConstToCard;