Skip to content

Commit

Permalink
set max len if not annotated
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Sep 30, 2023
1 parent 008e702 commit 0933c9f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vyper/builtins/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,11 @@ def build_IR(self, expr, args, kwargs, context):

# Get returntype string or bytes
dst_typ = expr._metadata.get("type")
assert isinstance(dst_typ, _BytestringT) or is_bytes32
assert isinstance(dst_typ, _BytestringT)

# set the length of the return type if it was not defined in annotation
if dst_typ.length == 0:
dst_typ.set_length(dst_maxlen)

# allocate a buffer for the return value
buf = context.new_internal_variable(BytesT(buflen))
Expand Down

0 comments on commit 0933c9f

Please sign in to comment.