Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make section start "nullable" (represented by std::nullopt) #45

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

antis81
Copy link
Contributor

@antis81 antis81 commented Jul 24, 2023

The basic idea is to enable bass's SymbolTable to interpret nullopt (aka "undefined", "None" or "nil") for typed arguments.
Currently such state does not exist (which in worst case can result in output holding "false positive" bytes - e.g. 0xff sometimes means -1 and sometimes it should error out instead - ⚡)

Addressing section "start", "pc" and "size" as a starting point.

To keep changes reviewable the logical behaviour of the assembler does not change here (at least not yet). What changes is only the comparison section.start == -1 vs !section.start.has_value() (alternatively section.start == std::nullopt).

antis81 added 3 commits July 24, 2023 16:04
…onal

Those will be serialized into the symbol table and
can now hold an additional "nullopt" (-> None) status.
However those values are still initialized with a -1 value
and behave as if they were an "int".

Means:
None of section start/pc/size will run into an "undefined" status.
Note that whenever we use section start as an algorithmic value
it has to be a "raw" int(!)

FYI:
Section start will still hold an int-value. The "else" in
Machine::layoutSections() will not take effect because
Check(section.start.has_value(), "Section must have start");
@antis81 antis81 changed the title Make section arguments "nullable" (represented by std::nullopt) Make section start "nullable" (represented by std::nullopt) Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant