Code: Select all
MODULE TestCompilerError;
CONST
length = 5;
PROCEDURE Name* (): POINTER TO ARRAY OF CHAR;
VAR string: POINTER TO ARRAY OF CHAR;
BEGIN
NEW(string, LEN length + 1);
RETURN string
END Name;
END TestCompilerError.
Code: Select all
MODULE TestCompilerError;
CONST
length = 5;
PROCEDURE Name* (): POINTER TO ARRAY OF CHAR;
VAR string: POINTER TO ARRAY OF CHAR;
BEGIN
NEW(string, LEN length + 1);
RETURN string
END Name;
END TestCompilerError.
Code: Select all
....
ELSIF f IN intSet THEN
IF f = Int64 THEN Convert(x, DevCPT.int32typ) END;
IF (x.class = Nconst) & (x.conval.intval <= 0) THEN err(63) END;
node := p.right;
IF node # NIL THEN (*+++*)
WHILE node.link # NIL DO node := node.link END;
node.link := x; p.typ := p.typ.BaseTyp
END (* +++ *)
ELSE err(111)
END
....
I agree that the title could be improved.luowy wrote:the revised code works well, but the title is a bit fuzzy, how about "compiler trap by NEW procedure" ?