Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nopython rewrites don't account for variables that should raise "NameError" #8865

Open
2 tasks done
stuartarchibald opened this issue Mar 30, 2023 · 0 comments
Open
2 tasks done
Labels
bug - incorrect behavior Bugs: incorrect behavior

Comments

@stuartarchibald
Copy link
Contributor

Reporting a bug

  • 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).
  • I have included a self contained code sample to reproduce the problem.
    i.e. it's possible to run as 'python bug.py'.

This:

from numba import njit

@njit('void(float64[::1],)')
def foo(out):
    for i in range(missing_definition1):
        while missing_definition2:
            out[i]

produces:

RuntimeError: liveness info missing for vars: {'i'}

from the nopython rewrites pass. The exception comes from here:

if missing_vars:
# There are no exit points
if not cfg.exit_points():
# We won't be able to verify this
pass
else:
msg = 'liveness info missing for vars: {0}'.format(missing_vars)
raise RuntimeError(msg)

It looks like that there's something wrong is identified, it's just that a more ICE-like error is raised than a NameError that would be expected by a user.

@stuartarchibald stuartarchibald added the bug - incorrect behavior Bugs: incorrect behavior label Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - incorrect behavior Bugs: incorrect behavior
Projects
None yet
Development

No branches or pull requests

1 participant