-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Handle Large Bit Fields #51
Comments
I noticed this as well. There's also the NSNumber (I think) ex you found, where VERY annoyingly the first bitfield field is encoded as There's no way to tell that it's signed just how many bits/wide it is. (so no way to have a perfect decode) |
To solve this issue however is going to be kinda gross, where I'll have to parse ALL the properties or stucts fields etc and then go BACK to determine the orig size of int. Shouldn't be too hard, just gross |
It was
@interface NSDecimalNumber : NSNumber {
/* instance variables */
unsigned int x :8 _exponent;
unsigned int x :4 _length;
unsigned int x :1 _isNegative;
unsigned int x :1 _isCompact;
unsigned int x :1 _reserved;
unsigned int x :1 _hasExternalRefCount;
unsigned int x :16 _refs;
unsigned short * _mantissa;
}
@interface NSDecimalNumber : NSNumber {
@private
signed int _exponent:8;
unsigned int _length:4;
unsigned int _isNegative:1;
unsigned int _isCompact:1;
unsigned int _reserved:1;
unsigned int _hasExternalRefCount:1;
unsigned int _refs:16;
unsigned short _mantissa[];
} |
We could technically omit the sign of the integer and let the user decide...
|
This is interesting: https://github.com/apple-oss-distributions/clang/blob/rel/clang-800/src/tools/clang/lib/AST/ASTContext.cpp#L5536-L5550 I wished LLVM had stuck with the GNU version rather than the NeXT version... |
lol, yes, that's MUCH nicer 😞 |
What happened?
We always set bit fields to
unsigned int
, but that fails when we have a bit field larger than 32 bits.Width of bit-field 'i' (128 bits) exceeds the width of its type (32 bits)
How can we reproduce this?
Decompile this:
go-macho version
v1.1.208
Search
Code of Conduct
Additional context
No response
The text was updated successfully, but these errors were encountered: