Skip to content

Commit

Permalink
Merge pull request #8092 from LemonBoy/b17874
Browse files Browse the repository at this point in the history
Fix issue 17874 - Static arrays & memset
merged-on-behalf-of: Walter Bright <WalterBright@users.noreply.github.com>
  • Loading branch information
dlang-bot authored Mar 27, 2018
2 parents 5bdf407 + 7254387 commit 161e2e0
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
Original file line number Diff line number Diff line change
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) &&
tyfloating(t2.Tty))
r = RTLSYM_MEMSET128;
}
}
Expand Down
14 changes: 14 additions & 0 deletions test/runnable/mars1.d
Original file line number Diff line number Diff line change
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 161e2e0

Please sign in to comment.