Peter Gerwinski wrote:
Frank has tracked down this error to the following: : : unit system; : interface : implementation : : var junk:integer; : : to begin do : for junk := 1 to 1 do; : : end.
There is another error in this initialization part (which presumably has nothing to do with the crash of the compiler). The variable ppJunk is New'ed, used to fill CmdLine, which is a pointer of pChar type, Then Dispose'd. So the memory to which CmdLine points is reputted into the heap, and can be overwrited by subsequent instructions in the main program. The following shot program displays the bug:
program Essai; {$x+} uses gpctypes, system;
var pBug:^String1024; begin writeln(cmdline); new(pBug); pBug^:='Non!!!'; writeln(cmdline); end.
when compiled and called with
essai Oui!!!
it OutPuts
Oui!!! Non!!!
Hope that it helps