Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Jul 13, 2023
1 parent 011dd6e commit 22085dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion vyper/codegen/function_definitions/external_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def _register_function_args(func_t: ContractFunctionT, context: Context) -> list
return ret


def _generate_kwarg_handlers(func_t: ContractFunctionT, context: Context) -> dict[str, tuple[int, IRnode]]:
def _generate_kwarg_handlers(
func_t: ContractFunctionT, context: Context
) -> dict[str, tuple[int, IRnode]]:
# generate kwarg handlers.
# since they might come in thru calldata or be default,
# allocate them in memory and then fill it in based on calldata or default,
Expand Down
6 changes: 3 additions & 3 deletions vyper/codegen/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def _selector_section_dense(external_functions, global_ctx):
assert dst >= 0

# XXX: re-enable this in debug mode:
#selector_section.append(["assert", ["eq", "msize", 0]])
# selector_section.append(["assert", ["eq", "msize", 0]])

selector_section.append(["codecopy", dst, bucket_hdr_location, SZ_BUCKET_HEADER])

Expand Down Expand Up @@ -291,7 +291,7 @@ def _selector_section_sparse(external_functions, global_ctx):
assert dst >= 0

# XXX: re-enable this in debug mode
#selector_section.append(["assert", ["eq", "msize", 0]])
# selector_section.append(["assert", ["eq", "msize", 0]])
selector_section.append(["codecopy", dst, bucket_hdr_location, SZ_BUCKET_HEADER])

jumpdest = IRnode.from_list(["mload", 0])
Expand Down Expand Up @@ -387,7 +387,7 @@ def generate_ir_for_module(global_ctx: GlobalContext) -> tuple[IRnode, IRnode]:

# XXX: AWAITING MCOPY PR
# dense vs sparse global overhead is amortized after about 4 methods
dense = False # if core._opt_codesize() and len(external_functions) > 4:
dense = False # if core._opt_codesize() and len(external_functions) > 4:
if dense:
selector_section = _selector_section_dense(external_functions, global_ctx)
else:
Expand Down
1 change: 1 addition & 0 deletions vyper/ir/compile_ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,7 @@ def __init__(self, label):
def __repr__(self):
return f"DATA {self.label}"


def relocate_segments(assembly):
# relocate all data segments to the end, otherwise data could be
# interpreted as PUSH instructions and mangle otherwise valid jumpdests
Expand Down

0 comments on commit 22085dc

Please sign in to comment.