as: tunit: fix dialyzer error

This commit is contained in:
Mikael Pettersson 2020-03-02 21:47:46 +01:00
parent 629ee7993d
commit 38ca3f4d40
2 changed files with 7 additions and 7 deletions

View File

@ -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 ---------------------------------------------------------

View File

@ -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 = #{}
}.