Skip to content

Commit b544c38

Browse files
authored
Merge pull request #117 from bashtage/remove-aliasing
CLN: Remove aliasing
2 parents b262e3c + a4b4354 commit b544c38

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

randomstate/interface/dSFMT/dSFMT-shim.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ static NPY_INLINE double random_double(aug_state *state) {
6767
}
6868

6969
static NPY_INLINE uint64_t random_raw_values(aug_state *state) {
70+
uint64_t out;
7071
double d = random_double_from_buffer(state);
71-
return *((uint64_t *)&d);
72+
73+
memcpy(&out, &d, sizeof(d));
74+
return out;
7275
}
7376

7477
extern void entropy_init(aug_state *state);

0 commit comments

Comments
 (0)