Skip to content

UB on PPC because vargs are not casted. #2458

@Rot127

Description

@Rot127

Expected behavior

No UB on PPC.

Actual behavior

The generator does not cast the varg arguments before passing them to add_cs_detail(). And sometimes it passes non-64bit values but unpacks them as uint64_t. Which is UB for some compilers (PPC apparently).
In general we should always cast to uint64_t values before passing them as vargs. The operand handler can cast them back.

Steps to reproduce the behavior

Compile Capstone for PPC.

Additional Logs, screenshots, source code, configuration dump, ...

Could be fixed by: #2135

cc @thestr4ng3r

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-SyncblockerMust be finished with the assigned milestone.bugSomething is not working as it shouldcode-generation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions