Skip to content

Commit

Permalink
raise CompilerPanic instead of assert
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdefinitelyahuman committed Sep 23, 2019
1 parent d0d076c commit e83a6e5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vyper/compile_lll.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import functools

from vyper.exceptions import (
CompilerPanic,
)
from vyper.parser.parser import (
LLLnode,
)
Expand Down Expand Up @@ -88,11 +91,13 @@ def apply_line_no_wrapper(*args, **kwargs):
def compile_to_assembly(code, withargs=None, existing_labels=None, break_dest=None, height=0):
if withargs is None:
withargs = {}
assert isinstance(withargs, dict)
elif not isinstance(withargs, dict):
raise CompilerPanic(f"Incorrect type for withargs: {type(withargs)}")

if existing_labels is None:
existing_labels = set()
assert isinstance(existing_labels, set)
elif not isinstance(existing_labels, set):
raise CompilerPanic(f"Incorrect type for existing_labels: {type(existing_labels)}")

# Opcodes
if isinstance(code.value, str) and code.value.upper() in opcodes:
Expand Down

0 comments on commit e83a6e5

Please sign in to comment.