diff --git a/erlang/apps/as/src/input.erl b/erlang/apps/as/src/input.erl index 0e66565..e0e9e2b 100644 --- a/erlang/apps/as/src/input.erl +++ b/erlang/apps/as/src/input.erl @@ -642,8 +642,8 @@ expr_fixup(Tunit, Expr) -> tunit_init() -> SectionText = section_dot_text(), - Tunit = tunit:put_section(tunit:new(), SectionText), - Tunit#tunit{cursect = SectionText#section.name}. + Cursect = SectionText#section.name, + tunit:put_section(tunit:new(Cursect), SectionText). %% Predefined Sections --------------------------------------------------------- diff --git a/erlang/apps/as/src/tunit.erl b/erlang/apps/as/src/tunit.erl index fe266f5..446dc11 100644 --- a/erlang/apps/as/src/tunit.erl +++ b/erlang/apps/as/src/tunit.erl @@ -1,7 +1,7 @@ %%% -*- erlang-indent-level: 2 -*- %%% %%% translation unit handling for pdp10-elf as. -%%% Copyright (C) 2013-2019 Mikael Pettersson +%%% Copyright (C) 2013-2020 Mikael Pettersson %%% %%% This file is part of pdp10-tools. %%% @@ -20,7 +20,7 @@ -module(tunit). --export([ new/0 +-export([ new/1 , get_section/2 , put_section/2 , get_symbol/2 @@ -33,10 +33,10 @@ %% API ------------------------------------------------------------------------- --spec new() -> #tunit{}. -new() -> +-spec new(string()) -> #tunit{}. +new(Cursect) -> #tunit{ sections = #{} - , cursect = false + , cursect = Cursect , symbols = #{} , local_labels = #{} }.