Skip to content

Commit 4128ea3

Browse files
committed
math: Fix another signed left shift in hypot
This function is using a << b for negative a, which is undefined. Signed-off-by: Keith Packard <[email protected]>
1 parent 2834e84 commit 4128ea3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

newlib/libm/math/s_hypot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ hypot64(__float64 x, __float64 y)
132132
__uint32_t high;
133133
t1 = _F_64(1.0);
134134
GET_HIGH_WORD(high, t1);
135-
SET_HIGH_WORD(t1, high + (k << 20));
135+
SET_HIGH_WORD(t1, high + lsl(k, 20));
136136
w *= t1;
137137
}
138138
return check_oflow(w);

0 commit comments

Comments
 (0)