Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Fix typeid(real).getHash() on 32-bit x86
Browse files Browse the repository at this point in the history
Where real.sizeof is 12, not 16, and so the 2 padding bytes weren't
ignored.

Fixes the rt.util.typeinfo unittests (only failing when testing the 32-bit
shared runtime unittests, which we don't in CI).
  • Loading branch information
kinke committed Mar 24, 2017
1 parent 7da56ea commit a3af613
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rt/util/typeinfo.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
module rt.util.typeinfo;

private enum isX87Real(T) = (T.sizeof == 16 && T.mant_dig == 64 && T.max_exp == 16384);
private enum isX87Real(T) = (T.mant_dig == 64 && T.max_exp == 16384);

template Floating(T)
if (is(T == float) || is(T == double) || is(T == real))
Expand Down

0 comments on commit a3af613

Please sign in to comment.