serge-sans-paille / pythran

Ahead of Time compiler for numeric kernels
https://pythran.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.99k stars 193 forks source link

Pythran crash on bogus asarray call #2156

Closed jeanlaroche closed 10 months ago

jeanlaroche commented 10 months ago

This simple file crashes pythran, latest version on mac os.

import numpy as np

# pythran export test(int?)
def test(sRate=44100):
    x = np.expand_dims(np.ones(sRate),-1)
    x = np.maximum(np.minimum(x,.5),-.5).asarray() #<- the asarray() is bogus (does not exist in numpy) but kills pythran.
    return x
serge-sans-paille commented 10 months ago

I can reproduce on Linux, thanks!