Skip to content

Commit

Permalink
add sanity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Jan 15, 2024
1 parent b67d361 commit 1089ee0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vyper/codegen/function_definitions/external_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ def generate_ir_for_external_function(code, compilation_target):
metadata required for `module.py` to construct the selector table.
"""
func_t = code._metadata["func_type"]
assert func_t.is_external or func_t.is_constructor # sanity check

context = initialize_context(func_t, compilation_target, func_t.is_constructor)
nonreentrant_pre, nonreentrant_post = get_nonreentrant_lock(func_t)

Expand Down
3 changes: 3 additions & 0 deletions vyper/codegen/function_definitions/internal_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def generate_ir_for_internal_function(

func_t = code._metadata["func_type"]

# sanity check
assert func_t.is_internal or func_t.is_constructor

context = initialize_context(func_t, module_ctx, is_ctor_context)

for arg in func_t.arguments:
Expand Down

0 comments on commit 1089ee0

Please sign in to comment.