Forum > FPC development
Panic (1002) Target OS: Linux for x86 ppcx64 can't be executed
Thaddy:
--- Quote from: MarkMLl on November 26, 2022, 12:10:18 pm ---Is n1[3] := n2 valid though? n1 is a classical pointer rather than (a pointer to) an (instance of) a class or some maintained type where I'd expect a missing dereference to be tolerated.
MarkMLl
--- End quote ---
It also depends on mode.
Thaddy:
Now have been able to test it for mode fpc, objpas and delphi: as I suspected, well, expected, runerror 216, access violation. Linux and Windows. That code is plain wrong. It will always fail (well, almost always if for some reason you have luck).
@MarkMLI in Mode Delphi, automatic deferencering is always on, so both forms should work (and do compile). But BOTH forms of the code crash as I expected....
Note I can not reproduce a kernel panic or crash, just the access violation. (all user mode)
(And at OP: the code does compile, you will just get a runtime error 216 as I predicted. My brain compiler from this morning is error prone, but not in this case and after testing with the real Freepascal compilers)
MarkMLl:
--- Quote from: Thaddy on November 26, 2022, 03:56:56 pm ---@MarkMLI in Mode Delphi, automatic deferencering is always on, so both forms should work (and do compile). But BOTH forms of the code crash as I expected....
--- End quote ---
In the general case, I'd not expect automatic dereferencing to apply to an ordinary array type i.e. with a declared number of parameters. If FPC does that... well, I'd much rather not get into yet another fight about whether it departs unduly from the spirit of Pascal as a simple strongly-typed language :-/
MarkMLl
marcov:
quantumfoam:
A compiler crash (GPF/runtime error, internal error) is always a bug, no matter how nonsensical the code is. Please report it with the reproducing piece of code in the bugtracker (which you already have).
If the example is extremely contrived (and IMHO this is not it), it just might take longer to resolve as it will not be high on the priority lists. But it is still a bug.
Thaddy:
Marco, it is not a compiler crash.
Navigation
[0] Message Index
[#] Next page
[*] Previous page