Skip to content

Update instruction docstrings - #2

Open
tom-krchnak wants to merge 3 commits into
mainfrom
update-docstrings
Open

tom-krchnak wants to merge 3 commits into
mainfrom
update-docstrings

Conversation

@tom-krchnak

Copy link
Copy Markdown

Lot of operations in instruction docstrings contradict the compiler output, mostly that operands are variables, when in fact they can be also constants. Also document the behaviour of free(NULL) and fix some typos.

@tom-krchnak
tom-krchnak requested a review from trtikm October 31, 2026 10:34
@trtikm

trtikm commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

I believe the only case, when those args can be constants are in the static initializer. Have seen those somewhere else (can you provide an example)?

Static initializer is special - it is not part of the original program and it is fully generated by the compiler. If the constant args appear only in the static initializer, then we could just make a note about that? Would not it be a better solution? What do you think?

@trtikm trtikm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes are all right. But we can perhaps resolve this by making a note about static initializer?

Comment thread include/sala/program.hpp
JUMP,

// BRANCH n vN
// BRANCH n nN

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think this can happen even in the static initializer. Because branching based on a constant is basically a JUMP.

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.

2 participants