mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Fixed segfault when compiling a non-constant case expression
This commit is contained in:
@@ -887,7 +887,7 @@ void SwitchStatement::toIR(IRState* p)
|
||||
VarDeclaration* vd = 0;
|
||||
if (cs->exp->op == TOKvar)
|
||||
vd = ((VarExp*)cs->exp)->var->isVarDeclaration();
|
||||
if (vd && !vd->init) {
|
||||
if (vd && (!vd->init || !vd->isConst())) {
|
||||
cs->llvmIdx = cs->exp->toElemDtor(p)->getRVal();
|
||||
useSwitchInst = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user