Skip to content

Commit

Permalink
fix Issue 15123 - segfault when compiling simple SIMD code
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Sep 27, 2015
1 parent 3b02f50 commit 074f4f3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/e2ir.c
Expand Up @@ -3804,10 +3804,7 @@ elem *toElem(Expression *e, IRState *irs)
{
Expression *elem;
if (ve->e1->op == TOKarrayliteral)
{
ArrayLiteralExp *ea = (ArrayLiteralExp *)ve->e1;
elem = (*ea->elements)[i];
}
elem = ((ArrayLiteralExp *)ve->e1)->getElement(i);
else
elem = ve->e1;
switch (elem->type->toBasetype()->ty)
Expand Down
14 changes: 14 additions & 0 deletions test/runnable/testxmm.d
Expand Up @@ -1396,6 +1396,20 @@ void test13988()
foo13988(arr);
}

/*****************************************/
// 15123

void test15123()
{
alias Vector16s = TypeTuple!(
void16, byte16, short8, int4, long2,
ubyte16, ushort8, uint4, ulong2, float4, double2);
foreach (V; Vector16s)
{
auto x = V.init;
}
}

/*****************************************/

int main()
Expand Down

0 comments on commit 074f4f3

Please sign in to comment.