numba icon indicating copy to clipboard operation
numba copied to clipboard

Function compilation not being updated for specific types on 32-bit systems

Open kc611 opened this issue 3 years ago • 1 comments

Reporting a bug

  • [x] I have tried using the latest released version of Numba (most recent is visible in the change log (https://github.com/numba/numba/blob/main/CHANGE_LOG).
  • [x] I have included a self contained code sample to reproduce the problem. i.e. it's possible to run as 'python bug.py'.

Note: This is only observed in 32-bit systems and not 64-bit ones.

import numba
import numpy as np

@numba.njit
def foo(x):
    print("from within: ",x)
    return x

foo(0)
print( foo( np.iinfo(np.int32).max + 1) )
# Returns a negative integer (overflow), the function signature stays as `int32` argument instead of an `int64`/`uint32`

First encountered in #8041

kc611 avatar Jul 29 '22 11:07 kc611

Note:

  • check typeof logic in dispatching. seems like it's always picking intp.

sklam avatar Aug 02 '22 14:08 sklam