GNU Pascal Homepage - gpc - gpc-announce - gpc-de - gpc-doc
Diese Seite auf deutsch

Mail #6328

Back to main page of archive

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  

From: levi@localhost.nc3a.nato.int
Subject: forward pointers
Date: 22 Jun 2001, 15:36:16



On Fri, 22 Jun 2001, Christopher Ferrall wrote:

> 
> This is listed in "Other known bugs"
> >     forward referencing pointers generate debug info that appears as generic pointers; no information of `with'
> >     statements is currently given to the debugger; error in debug entries generated for objects
> 
> Is this the same as this problem:
> 
> type
>    xptr = ^x_type;
>    x_type = record
> 	     stuff ...
>              next : xptr;
>             end;
> var 
>    xlist,
>    x     : xptr;
> begin
>    new(xlist); xlist.next:=nil;

This line should read:
     new(xlist); xlist^.next:=nil;

>    ...
>    x := xlist;
>    repeat with x^ do begin

Since there is no code here to end the loop replaced it with a for-loop.
Also the begin does not have a matching end.
 
>      new(next);
>      x := next;
>    until no_more_to_create;
> 
> At runtime:
>   Program received signal SIGSEGV, Segmentation fault.
> Inside gdb:
>  (gdb) print x[0]
>   Attempt to dereference a generic pointer.
>
While I have not used gbd, with the changes above the program works.
Increasing the size of the for-loop to force it to run out of heap
and the program exits with a "out of heap" message.
Conclusion: you are dereferencing a pointer but the dereference is
in code you didn't supply.

Hope this helps
  Russ

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  


In reply to

Author Subject Date
Christopher Ferrall forward pointers 22 Jun 2001, 12:38:08

Back to main page of archive


Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.

Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.


This page was created by Crystal 0.999 (Linux 2.4.27/i686).