Просмотр исходного кода

scanner Reset: NEW(buf[i]) typed alloc (BufBlock needs a descriptor header under V3's open-array ABI)

Eric Streit 2 недель назад
Родитель
Сommit
af392e1ac6
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      compiler/src/scanner.frm

+ 2 - 1
compiler/src/scanner.frm

@@ -3,6 +3,7 @@ IMPLEMENTATION MODULE -->modulename;
 (* Scanner generated by Coco/R - using the FileIO library supplied with this project. *)
 
 IMPORT FileIO, Storage;
+FROM Storage IMPORT ALLOCATE;  (* gm2 needs this for NEW substitution *)
 
 CONST
   noSYMB  = -->unknownsym; (*error token code*)
@@ -146,7 +147,7 @@ PROCEDURE Reset;
   BEGIN (*assert: src has been opened*)
     i := 0; inputLen := 0;
     REPEAT
-      Storage.ALLOCATE(buf[i], BlkSize);
+      NEW(buf[i]);   (* typed alloc: sets the block descriptor's count *)
       read := BlkSize; FileIO.ReadBytes(src, buf[i]^, read);
       INC(i); INC(inputLen, VAL(INT32, read))
     UNTIL read # BlkSize;