Skip to content

Commit

Permalink
Fix issue 17874 - Static arrays & memset
Browse files Browse the repository at this point in the history
Hopefully completes what #3784 started.
  • Loading branch information
LemonBoy committed Mar 27, 2018
1 parent 2e21d07 commit 5662aa9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dmd/e2ir.d
Expand Up @@ -965,8 +965,8 @@ Lagain:
}
else if (config.exe != EX_WIN64 &&
r == RTLSYM_MEMSET128ii &&
t1.Tty == TYdouble &&
t2.Tty == TYdouble)
tyfloating(t1.Tty) != 0 &&
tyfloating(t2.Tty) != 0)
r = RTLSYM_MEMSET128;
}
}
Expand Down
14 changes: 14 additions & 0 deletions test/runnable/mars1.d
Expand Up @@ -1244,6 +1244,19 @@ void test9449()
if (arr[0].g != 4.0) assert(0);
}

struct Point9449x
{
float f = 0.0;
double g = 0.0;
}

void test9449x()
{
Point9449x[1] arr;
if (arr[0].f != 0.0) assert(0);
if (arr[0].g != 0.0) assert(0);
}

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

Expand Down Expand Up @@ -1806,6 +1819,7 @@ int main()
test13023(0x10_0000_0000);
test12833();
test9449();
test9449x();
test12057();
test13784();
test14220();
Expand Down

0 comments on commit 5662aa9

Please sign in to comment.