Skip to content

Commit

Permalink
fix Issue 16116 - Infinite loop on (somewhat complex) simd math
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Nov 21, 2016
1 parent f5a73f3 commit 089cea8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dcast.d
Expand Up @@ -3202,6 +3202,8 @@ Lagain:
{
if (t1.ty != t2.ty)
{
if (t1.ty == Tvector || t2.ty == Tvector)
goto Lincompatible;
e1 = integralPromotions(e1, sc);
e2 = integralPromotions(e2, sc);
t1 = e1.type;
Expand Down
16 changes: 16 additions & 0 deletions test/fail_compilation/test16116.d
@@ -0,0 +1,16 @@
/*
REQUIRED_ARGS: -m64
PERMUTE_ARGS:
TEST_OUTPUT:
---
fail_compilation/test16116.d(15): Error: incompatible types for ((v) * (i)): '__vector(short[8])' and 'int'
---
*/

// https://issues.dlang.org/show_bug.cgi?id=16116

void foo() {
__vector(short[8]) v;
int i;
v = v * i;
}

0 comments on commit 089cea8

Please sign in to comment.