Skip to content

Pass undef if semantic function argument is unused#716

Merged
Ninja3047 merged 1 commit intolifting-bits:masterfrom
momo5502:master
Jul 4, 2025
Merged

Pass undef if semantic function argument is unused#716
Ninja3047 merged 1 commit intolifting-bits:masterfrom
momo5502:master

Conversation

@momo5502
Copy link
Contributor

@momo5502 momo5502 commented Jul 3, 2025

Using IntendedArgumentType to resolve the intended argument type fails if the argument has no uses.
This is for example the case for the destination register of the FLD instruction semantics:

DEF_FPU_SEM(FLD, RF80W, T src1) {

Not being able to resolve the intended type will then lead to the destination register being treated as source.
This in turn causes an assertion to be thrown.

As the argument is unused though, it doesn't matter what's passed. Therefore passing undef will work just fine.

Remill tries to infer the proper type of an argument for a semantic function.
If the argument is unused that won't work and yields wrong results.
However, in that case, it doesn't matter what's passed,
as nobody uses the value, so passing undef works and prevents issues.
@CLAassistant
Copy link

CLAassistant commented Jul 3, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@Ninja3047 Ninja3047 left a comment

Choose a reason for hiding this comment

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

makes sense, thanks!

@Ninja3047 Ninja3047 merged commit f59f129 into lifting-bits:master Jul 4, 2025
5 checks passed
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.

3 participants