mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +00:00
fix assertion abort when generating boot image
In makeCodeImage, we were passing zero to Promise::Listener::resolve, which would lead to an assertion error if the address of the code image was further from the base of the address space (i.e. zero) than could be spanned by a jump on the target architecture. Since, in this context, we immediately overwrite the value stored, we may pass whatever we want to this function (we're only calling it so we can retrieve the location of the value in the image), and the code image pointer is a better choice for the above reason.
This commit is contained in:
parent
3d49173b0b
commit
2d0ff83653
@ -170,7 +170,8 @@ makeCodeImage(Thread* t, Zone* zone, BootImage* image, uint8_t* code,
|
||||
assert(t, value >= code);
|
||||
|
||||
void* location;
|
||||
bool flat = addresses->listener->resolve(0, &location);
|
||||
bool flat = addresses->listener->resolve
|
||||
(reinterpret_cast<int64_t>(code), &location);
|
||||
uintptr_t offset = value - code;
|
||||
if (flat) {
|
||||
offset |= BootFlatConstant;
|
||||
|
Loading…
Reference in New Issue
Block a user