mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Fixed a segfault when using opDollar for struct and class indexing operations
This commit is contained in:
@@ -151,9 +151,14 @@ DValue* VarExp::toElem(IRState* p)
|
||||
else if (vd->ident == Id::dollar)
|
||||
{
|
||||
Logger::println("Id::dollar");
|
||||
LLValue* val = 0;
|
||||
if (vd->ir.isSet() && (val = vd->ir.getIrValue())) {
|
||||
// It must be length of a range
|
||||
return new DVarValue(type, vd, val);
|
||||
}
|
||||
assert(!p->arrays.empty());
|
||||
LLValue* tmp = DtoArrayLen(p->arrays.back());
|
||||
return new DImValue(type, tmp);
|
||||
val = DtoArrayLen(p->arrays.back());
|
||||
return new DImValue(type, val);
|
||||
}
|
||||
// classinfo
|
||||
else if (ClassInfoDeclaration* cid = vd->isClassInfoDeclaration())
|
||||
|
||||
Reference in New Issue
Block a user