You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I looked at this issue and it seems that even if you specify that the enum is 8 bit values, internally they are always 128 bits for the sake of simplifying the code. When you write None = -1, the pattern language interprets it as None = 0xFFFFFFFFFFFFFFFF. To being able to match 0xFF the PL would need to check the underlying type to parse the statement to mean None=0x00000000000000FF but that is not -1 in 128 bit representation so I can see why it doesn't do that. What it should try to do is to assign the value the the underlying type would have to be in order to satisfy the assignment and then convert that to a 128 bit integer, literally None = u8(-1),.
That can be inserted in the code to test if it would fix the issue
which only works for positive numbers. I don't think this will be hard to code and I don't think it will have unforeseen effects but I am busy with other projects so this would have to wait a bit and if nobody picks it up in the mean time I'll tackle it in the future.
Operating System
Windows
What's the issue you encountered?
Cant create signed enums.
How can the issue be reproduced?
input:
FF FE 00 00 00
output:
expected output:
t = Test::None
ImHex Version
1.37.1
ImHex Build Type
Installation type
portable
Additional context?
No response
The text was updated successfully, but these errors were encountered: