Use larger type than long for pointers for win64 model
Bug #871453 reported by
Martin Packman
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Meliae |
New
|
Undecided
|
Unassigned |
Bug Description
Various code in meliae assumes that the long type is large enough to hold a pointer value, this isn't true in the LLP64 model used by win64. This is acknowledged by the code:
/* TODO: This is casting a pointer into an unsigned long, which we assume
* is 'long enough'. We probably should really be using uintptr_t or
* something like that.
*/
The one pitfall with just correcting to a platform appropriate type is that text dumps generated on 64-bit machine may not be loadable on a 32-bit machine. Depending on whether the extra memory usage is problematic or not, always using an 8 byte value in the loader code would get around that problem,
To post a comment you must log in.