]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR modula2/120389 ICE if assigning a constant char to an integer array
authorGaius Mulley <gaiusmod2@gmail.com>
Thu, 22 May 2025 21:03:22 +0000 (22:03 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Thu, 22 May 2025 21:03:22 +0000 (22:03 +0100)
commit895a8abad245365940939911e3d0de850522791e
tree909ad21fba001f94c8d89b0b3aff8a01bcd28c87
parent05fc1470798601f610653cac4f6a55a9c83928f4
PR modula2/120389 ICE if assigning a constant char to an integer array

This patch fixes an ICE which occurs if a constant char is assigned
into an integer array.  The fix it to introduce type checking in
M2GenGCC.mod:CodeXIndr.

gcc/m2/ChangeLog:

PR modula2/120389
* gm2-compiler/M2GenGCC.mod (CodeXIndr): Check to see that
the type of left is assignment compatible with the type of
right.

gcc/testsuite/ChangeLog:

PR modula2/120389
* gm2/iso/fail/badarray3.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/M2GenGCC.mod
gcc/testsuite/gm2/iso/fail/badarray3.mod [new file with mode: 0644]