Skip to content

Commit

Permalink
Merge pull request #3938 from esc/better_error_for_unknown_opcode
Browse files Browse the repository at this point in the history
Better error message for unknown opcode
  • Loading branch information
stuartarchibald committed Apr 8, 2019
2 parents 3c78a40 + 869394c commit a8d7c62
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions numba/dataflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import warnings

from numba import utils
from .errors import UnsupportedError
from .ir import Loc


class DataFlowAnalysis(object):
Expand Down Expand Up @@ -88,9 +90,11 @@ def dispatch(self, info, inst):
fn(info, inst)

def handle_unknown_opcode(self, info, inst):
msg = "Use of unknown opcode {} at line {} of {}"
raise NotImplementedError(msg.format(inst.opname, inst.lineno,
self.bytecode.func_id.filename))
raise UnsupportedError(
"Use of unknown opcode '{}'".format(inst.opname),
loc=Loc(filename=self.bytecode.func_id.filename,
line=inst.lineno)
)

def dup_topx(self, info, inst, count):
orig = [info.pop() for _ in range(count)]
Expand Down

0 comments on commit a8d7c62

Please sign in to comment.