]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR modula2/111510 runtime ICE findChildAndParent has caused internal runtime error
authorGaius Mulley <gaiusmod2@gmail.com>
Tue, 26 Sep 2023 17:08:37 +0000 (18:08 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Tue, 26 Sep 2023 17:08:37 +0000 (18:08 +0100)
commit53daf67fd55e005e37cb3ab33ac0783a71761de9
treea9595aa80b3e6824ee8f51ad346da408cc28b2ef
parente1e18ea0defe9e1ee35abbbe5279028ecf786957
PR modula2/111510 runtime ICE findChildAndParent has caused internal runtime error

This patch fixes the runtime bug above.  The full runtime message is:
findChildAndParent has caused internal runtime error, RTentity is either
corrupt or the module storage has not been initialized yet.  The bug is
due to a non nul terminated string determining the module initialization order.
This results in modules being uninitialized and the above crash.  The bug
manifests itself on 32 bit systems - but obviously is latent on all
targets and the fix should be applied to both gcc-14 and gcc-13.

gcc/m2/ChangeLog:

PR modula2/111510
* gm2-compiler/M2GenGCC.mod (IsExportedGcc): Minor spacing changes.
(BuildTrashTreeFromInterface): Minor spacing changes.
* gm2-compiler/M2Options.mod (GetRuntimeModuleOverride): Call
string to generate a nul terminated C style string.
* gm2-compiler/M2Quads.mod (BuildStringAdrParam): New procedure.
(BuildM2InitFunction): Replace inline parameter generation with
calls to BuildStringAdrParam.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/M2GenGCC.mod
gcc/m2/gm2-compiler/M2Options.mod
gcc/m2/gm2-compiler/M2Quads.mod