iraf-v216 · Code · Issues (50) · Pull requests (81)
iraf.net pull request #62
Fix ADDR_TO_LOC for i386 (32 bit)
olebole merged 2 commits to iraf-community/iraf
olebole commented on 2017-05-16
The address LOC needs to be not negative. The right shift in the original code however may be (implementation dependent) shift in a 1, resulting in a negative LOC:
ISO/IEC 9899/1999, §6.5.8:
- The result of
E1 >> E2
isE1
right-shiftedE2
bit positions. IfE1
has an unsigned type or ifE1
has a signed type and a nonnegative value, the value of the result is the integral part of the quotient ofE1 / 2^E2
. IfE1
has a signed type and a negative value, the resulting value is implementation-defined.
We explicitly cast it into an unsigned before rightshifting. This will shift in a zero.
This fixes #61.
We can also remove an ugly “workaround” for this problem in the cl startup shell script.
Commits
- Reset the MSB in the result of ADDR_TO_LOC [f464a520]
- Remove
ulimit -s unlimited
from cl startup [fe438962]
Last updated on 2017-10-20