aboutsummaryrefslogtreecommitdiff
path: root/src/lua/COPYRIGHT
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-11-01 11:16:18 -0500
committerkwolekr <kwolekr@minetest.net>2015-11-01 11:16:18 -0500
commitd198e420ec54be47fe2285b3205953282ec06742 (patch)
tree9cb8f150ebb0c84b3db5f86e70ee7aad2be01f3d /src/lua/COPYRIGHT
parent9269a0ecc7267822bc5ac5af95ad4977bdc94fec (diff)
Fix Noise compiled under clang >= 3.7.x with -O2 or higher
When compiled with optimizations, the most recent versions of clang seem to 'optimize' out a crucial "and %reg, 0x7FFFFFFF" instruction in noise2d(), probably because it somehow assumed the variable n would never become greater than that amount. Indeed, signed integer underflow is undefined behavior in C and C++, so while this optimization is "correct" in that sense, it breaks lots of existing code. Solved by changing n to an unsigned type, making behavior well-defined.
Diffstat (limited to 'src/lua/COPYRIGHT')
0 files changed, 0 insertions, 0 deletions
18' href='#n118'>118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166