mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-28 18:43:13 +01:00
Fix for issue #440
This commit is contained in:
@@ -450,9 +450,17 @@ void TypeInfoEnumDeclaration::llvmDefine()
|
||||
// otherwise emit a void[] with the default initializer
|
||||
else
|
||||
{
|
||||
LLType* memty = DtoType(sd->memtype);
|
||||
LLConstant* C = LLConstantInt::get(memty, sd->defaultval->toInteger(), !isLLVMUnsigned(sd->memtype));
|
||||
b.push_void_array(C, sd->memtype, sd);
|
||||
Type *memtype = sd->memtype;
|
||||
LLType *memty = DtoType(memtype);
|
||||
LLConstant *C;
|
||||
if (memtype->isintegral())
|
||||
C = LLConstantInt::get(memty, sd->defaultval->toInteger(), !isLLVMUnsigned(memtype));
|
||||
else if (memtype->isString())
|
||||
C = DtoConstString(static_cast<const char *>(sd->defaultval->toString()->string));
|
||||
else
|
||||
llvm_unreachable("Unsupported type");
|
||||
|
||||
b.push_void_array(C, memtype, sd);
|
||||
}
|
||||
|
||||
// finish
|
||||
|
||||
Submodule tests/d2/dmd-testsuite updated: 34ab16a4fc...6ff7ed4b70
Reference in New Issue
Block a user