diff --git a/src/interpret.c b/src/interpret.c index b2fb8c3c3f65..c0600a9e55df 100644 --- a/src/interpret.c +++ b/src/interpret.c @@ -4176,9 +4176,9 @@ class Interpreter : public Visitor newelem = paintTypeOntoLiteral(elemtype, newelem); if (needsPostblit) { - newelem = evaluatePostblit(istate, newelem); - if (exceptionOrCantInterpret(newelem)) - return newelem; + Expression *x = evaluatePostblit(istate, newelem); + if (exceptionOrCantInterpret(x)) + return x; } (*oldelems)[(size_t)(j + firstIndex)] = newelem; } diff --git a/test/compilable/interpret3.d b/test/compilable/interpret3.d index d893d7212921..9f7f107e34e7 100644 --- a/test/compilable/interpret3.d +++ b/test/compilable/interpret3.d @@ -7378,6 +7378,20 @@ static assert( return 1; }()); +/************************************************** + 14463 - ICE on slice assignment without postblit +**************************************************/ + +struct Boo14463 +{ + private int[1] c; + this(int[] x) + { + c = x; + } +} +immutable Boo14463 a14463 = Boo14463([1]); + /************************************************** 13295 - Don't copy struct literal in VarExp::interpret() **************************************************/