]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/d/d-codegen.cc
d: fix ICE at convert_expr(tree_node*, Type*, Type*) (PR101490)
authorIain Buclaw <ibuclaw@gdcproject.org>
Mon, 26 Jul 2021 13:11:42 +0000 (15:11 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Wed, 28 Jul 2021 11:13:05 +0000 (13:13 +0200)
commitc936c39f86c74b3bfc6831f694b3165296c99dc0
tree1ec07b3f72bc318fa0a2e16dbdac4b544c659154
parent1a2306ffe79df89389cc850ce85c586d0f1c8264
d: fix ICE at convert_expr(tree_node*, Type*, Type*) (PR101490)

Both the front-end and code generator had a modulo by zero bug when testing if
a conversion from a static array to dynamic array was valid.

PR d/101490

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd 27e388b4c.
* d-codegen.cc (build_array_index): Handle void arrays same as byte.
* d-convert.cc (convert_expr): Handle converting to zero-sized arrays.

gcc/testsuite/ChangeLog:

* gdc.dg/pr101490.d: New test.
gcc/d/d-codegen.cc
gcc/d/d-convert.cc
gcc/d/dmd/MERGE
gcc/d/dmd/dcast.c
gcc/testsuite/gdc.dg/pr101490.d [new file with mode: 0644]
gcc/testsuite/gdc.test/fail_compilation/fail22144.d [new file with mode: 0644]