09:22:01 GMT)
lang.pascal.borland:501
From: Marco van de Voort
On 2012-01-12, Adrian Devries wrote:
> I've managed to compile your sources with both VirtualPascal and
> FreePascal.
I've succeeded also, but the program crashed. It seems the program assumes
that variables are in sequence in the datasegment, and it uses pointers to
poke into them. Most notably triples of pointers (xxx_nxt, xxx_top, xxx_ptr)
It seems that with the current FPC versions that (wrong) assumption doesn't
apply any more.
The symptom was that lift_top was NIL after readfile, because that pointer
was updated via the above mechanism.
A possible solution would be to enforce grouping with e.g. the following
trick
type PWhateverPointer=pchar;
Type
THetPointerRecord = packed record
nxt,
top,
_ptr : PWhateverPointer;
end;
const
list_dummy :THetPointerRecord = (nxt:nil;top:nil;_ptr:nil);
var
list_nxt : PWhateverPointer absolute list_dummy.nxt;
list_top : PWhateverPointer absolute list_dummy.top;
list_ptr : PWhateverPointer absolute list_dummy._ptr;
--- Internet Rex 2.31
* Origin: The gateway at Omicron Theta (1:261/20.999)
|