diff options
author | kwolekr <kwolekr@minetest.net> | 2016-05-11 03:47:45 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2016-05-27 23:23:58 -0400 |
commit | b1eb757e60c155707b8fc1b2497b632246819c7b (patch) | |
tree | 96e9b35b1e0f2b300f379a2703f659130cdab534 /src/threading | |
parent | 5b05f75a272ede582d7f86d8dbbbf7bc81e81970 (diff) | |
download | minetest-b1eb757e60c155707b8fc1b2497b632246819c7b.tar.gz minetest-b1eb757e60c155707b8fc1b2497b632246819c7b.tar.bz2 minetest-b1eb757e60c155707b8fc1b2497b632246819c7b.zip |
Fix undefined evaluation order when constructing random vectors
MSVC and GCC evaluate parameters in right-to-left order, whereas Clang
evaluates in left-to-right order, and of course, an optimization could
leave the order of evaluation completely indeterminate.
This commit fixes all instances of the error by explicitly assigning the
results of expressions that use PseudoRandom::next() or range() to their
respective vector components.
The right-to-left evaluation behavior is preserved since Clang is much less
commonly used to compile Minetest than GCC and MSVC combined, and would
therefore cause the least harm.
Diffstat (limited to 'src/threading')
0 files changed, 0 insertions, 0 deletions