ImportC: Gracefully terminate when encountering C initializer lists

Instead of ICE'ing; e.g., for dmd-testsuite's runnable/cstuff2.c.
See #3825.
This commit is contained in:
Martin Kinkelin 2021-09-10 21:58:59 +02:00
parent 50fb6c8638
commit 067fbafd59

View file

@ -1084,6 +1084,10 @@ LLConstant *DtoConstInitializer(const Loc &loc, Type *type, Initializer *init) {
Logger::println("const void initializer");
LLType *ty = DtoMemType(type);
_init = LLConstant::getNullValue(ty);
} else if (CInitializer *ci = init->isCInitializer()) {
// TODO: ImportC
error(loc, "LDC doesn't support C initializer lists yet");
fatal();
} else {
// StructInitializer is no longer suposed to make it to the glue layer
// in DMD 2.064.