]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PATCH] PR modula2/120389 ICE if assigning a constant char to an integer array
authorGaius Mulley <gaiusmod2@gmail.com>
Tue, 15 Jul 2025 18:38:04 +0000 (19:38 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Tue, 15 Jul 2025 18:38:04 +0000 (19:38 +0100)
commit7dcb64479e0cc590641a505b8fe1fd542f22a38f
tree21d42d672e1d8a2e5fe2488028ba7c47d1e855d1
parentc9965c37cd153b7764f147a77489db9827071ad0
[PATCH] 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.

(cherry picked from commit 895a8abad245365940939911e3d0de850522791e)

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]