Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!psuvax1!vu-vlsi!swatsun!schwartz From: schwartz@swatsun (Scott Schwartz) Newsgroups: comp.sources.d Subject: latest bug in ptc Message-ID: <1244@carthage.swatsun.UUCP> Date: Thu, 6-Aug-87 15:06:39 EDT Article-I.D.: carthage.1244 Posted: Thu Aug 6 15:06:39 1987 Date-Received: Sat, 8-Aug-87 14:54:47 EDT Organization: Swarthmore College, Swarthmore PA Lines: 50 Keywords: problem in var parameter handling Here is another bug in ptc (published in comp.sources.unix) Consider the following program: program main; type trecptr = ^trec; trec = record field: integer; end; procedure test(var recp: trecptr); begin recp^.field := 0; end; begin end. What gets generated by ptc is: extern void exit(); typedef int integer; extern char *strncpy(); typedef struct S59 * trecptr; typedef struct S59 { integer field; } trec; void test(recp) trecptr *recp; { recp->->field = 0; /* GAAAK !!! */ } main() { exit(0); } The bug seems to be in the handling of pointers to records passed as var parameters. Time to go dig into the source :-( -- # Scott Schwartz # ...{{seismo,ihnp4}!bpa,cbmvax!vu-vlsi,sun!liberty}!swatsun!!pyra:09