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

[Lifter] Represent BNinja void correctly #405

Closed
NeoQuix opened this issue Mar 26, 2024 · 2 comments · Fixed by #415
Closed

[Lifter] Represent BNinja void correctly #405

NeoQuix opened this issue Mar 26, 2024 · 2 comments · Fixed by #415
Assignees
Labels
feature-request New feature or request

Comments

@NeoQuix
Copy link
Collaborator

NeoQuix commented Mar 26, 2024

Proposal

Currently the lifter implicitly promotes a detected BNinja void type into an void* because C (and DeWolf) does not have a concept of a void datatype.
This leads to the problem of the lifter deciding when to drop a & or not, which again is not its job.

With the new array type, we can represent an void type as an constant array of bytes, e.g. unsigned char [].
This fixes the problem of "cheating" the type into an pointer.
The value will still stay the same (string of escaped hex chars).

Approach

Change globals.py _lift_void_type to return an unsigned char[] instead of an void*.
Fix possible problems at the backend for correct printing.

@NeoQuix NeoQuix added the feature-request New feature or request label Mar 26, 2024
@NeoQuix NeoQuix self-assigned this Mar 26, 2024
@NeoQuix
Copy link
Collaborator Author

NeoQuix commented Jun 11, 2024

/cib

Copy link
Contributor

github-actions bot added a commit that referenced this issue Jun 11, 2024
blattm added a commit that referenced this issue Jun 24, 2024
* Create draft PR for #405

* Add: uchar8 for void

* Remove void* hack

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Spartak Ehrlich <[email protected]>
Co-authored-by: Manuel Blatt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant