You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The previous commit exposed undefined behaviour elsewhere that is
the result of old ksh bugs. My 2021 attempt to fix it in 23b7a16
was also wrong.
src/cmd/ksh93/sh/init.c: put_rand(), put_lineno(), put_lastarg():
- An incorrect typecast to double instead of Sfdouble_t (which
translates to 'long double' on most systems, but not on macOS M1)
caused arithmetic assignments to RANDOM, LINENO and _ to produce
undefined results where sizeof(long double)!=sizeof(double). As
ksh has been using Sfdouble_t for all arithmetic operations for
years, fix the bug by typecasting to Sfdouble_t instead.
src/cmd/ksh93/tests/arith.sh:
- Fix the tests added in the previous commit to tolerate
system-dependent rounding errors.
0 commit comments