[Bug modula2/119504] ICE when attempting to access an element of a constant string
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Mar 28 15:26:43 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119504
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <gaius@gcc.gnu.org>:
https://gcc.gnu.org/g:b69945d511b394ef092c888c6475f8c72bee0c03
commit r15-9011-gb69945d511b394ef092c888c6475f8c72bee0c03
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date: Fri Mar 28 15:25:55 2025 +0000
PR modula2/119504: ICE when attempting to access an element of a constant
string
This patch prevents an ICE and generates an error if an array access to a
constant string is attempted. The patch also allows HIGH ("string").
gcc/m2/ChangeLog:
PR modula2/119504
* gm2-compiler/M2Quads.mod (BuildHighFunction): Defend against
Type = NulSym and fall into BuildConstHighFromSym.
(BuildDesignatorArray): Rewrite to detect an array access to
a constant string.
(BuildDesignatorArrayStaticDynamic): New procedure.
gcc/testsuite/ChangeLog:
PR modula2/119504
* gm2/iso/fail/conststrarray2.mod: New test.
* gm2/iso/run/pass/constarray2.mod: New test.
* gm2/pim/pass/hexstring.mod: New test.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
More information about the Gcc-bugs
mailing list