* Avoid access violation, use internalerror instead. See also issue #40502

This commit is contained in:
Michaël Van Canneyt 2023-11-06 10:53:57 +01:00
parent 85338e2d05
commit 63a8fe07ee

View File

@ -2752,7 +2752,20 @@ uses
interface is still being parsed and thus the localsymtable is in
reality the global symtable }
if pu.u.in_interface then
symtablestack.push(pu.u.localsymtable)
begin
{
MVC: The case where localsymtable is also nil can appear in complex cases and still produce valid code.
In order to allow people in this case to continue, SKIP_INTERNAL20231102 can be defined.
Default behaviour is to raise an internal error.
}
{$IFDEF SKIP_INTERNAL20231102}
if (pu.u.localsymtable<>Nil) then
{$ELSE}
if (pu.u.localsymtable=Nil) then
internalerror(20231102);
{$ENDIF}
symtablestack.push(pu.u.localsymtable);
end
else
internalerror(200705153)
else