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

[Bug] Using #pragma bitfield_order crashes the application #1828

Closed
1 task
bucccket opened this issue Jul 24, 2024 · 0 comments
Closed
1 task

[Bug] Using #pragma bitfield_order crashes the application #1828

bucccket opened this issue Jul 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@bucccket
Copy link

Operating System

Windows

What's the issue you encountered?

I wanted to globally specify the bitfield order for a pattern I am working on, so I used the #pragma directive like specified in the docs.
Interestingly enough it should say that it's unsupported as I found out later fiddling around with reproducing the behavior, HOWEVER if you put #pragma endian little before, it doesn't do that. (probably due to crashing before being able to handle the error)

How can the issue be reproduced?

#pragma endian little
#pragma bitfield_order left_to_right

bitfield RECT{
    nbits:5;
    signed xmin:nbits;
    signed xmax:nbits;
    signed ymin:nbits;
    signed ymax:nbits;
};

RECT rect_at_0x08 @ 0x08;

ImHex Version

1.35.4

ImHex Build Type

  • Nightly or built from sources

Installation type

MSI

Additional context?

There is no specific pattern of data causing the issue. This seems to just be an awkward hole in the logic from what I can gather.
In general I am left puzzled with bifield oder, as it only seems to produce the right output when I use 'be'. e.g. the attribute does not seem to work the same way and in general does not work well for my usecase, since my bitfield is variable in size.

@bucccket bucccket added the bug Something isn't working label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant