From 417e6aa070cca00f50dfd7e1fc792a128a41d2fd Mon Sep 17 00:00:00 2001 From: Edward Amor Date: Fri, 12 Nov 2021 18:26:43 +0000 Subject: [PATCH] chore: leave todo, come back and resolve immutable offsets at compile time --- vyper/old_codegen/expr.py | 1 + vyper/old_codegen/parser.py | 1 + 2 files changed, 2 insertions(+) diff --git a/vyper/old_codegen/expr.py b/vyper/old_codegen/expr.py index 761f5b13623..5251c1126c4 100644 --- a/vyper/old_codegen/expr.py +++ b/vyper/old_codegen/expr.py @@ -340,6 +340,7 @@ def parse_Name(self): else: immutable_section_size = self.context.global_ctx.immutable_section_size offset = self.expr._metadata["type"].position.offset + # TODO: resolve code offsets for immutables at compile time return LLLnode.from_list( ["sub", "codesize", immutable_section_size - offset], typ=var.typ, diff --git a/vyper/old_codegen/parser.py b/vyper/old_codegen/parser.py index 020d11bd1f5..903141222f3 100644 --- a/vyper/old_codegen/parser.py +++ b/vyper/old_codegen/parser.py @@ -180,6 +180,7 @@ def parse_regular_functions( immutables = [_global for _global in global_ctx._globals.values() if _global.is_immutable] + # TODO: enable usage of the data section beyond just user defined immutables if len(immutables) > 0: # find position of the last immutable so we do not overwrite it in memory # when we codecopy the runtime code to memory