mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +00:00
fix integer truncation bug
This commit is contained in:
parent
cec6444911
commit
f702795178
12
src/common.h
12
src/common.h
@ -260,6 +260,18 @@ pad(unsigned n)
|
||||
return pad(n, BytesPerWord);
|
||||
}
|
||||
|
||||
inline uintptr_t
|
||||
padWord(uintptr_t n, uintptr_t alignment)
|
||||
{
|
||||
return (n + (alignment - 1)) & ~(alignment - 1);
|
||||
}
|
||||
|
||||
inline uintptr_t
|
||||
padWord(uintptr_t n)
|
||||
{
|
||||
return padWord(n, BytesPerWord);
|
||||
}
|
||||
|
||||
inline unsigned
|
||||
ceiling(unsigned n, unsigned d)
|
||||
{
|
||||
|
@ -7694,7 +7694,7 @@ boot(MyThread* t, BootImage* image)
|
||||
unsigned* callTable = stringTable + image->stringCount;
|
||||
|
||||
uintptr_t* heapMap = reinterpret_cast<uintptr_t*>
|
||||
(pad(reinterpret_cast<uintptr_t>(callTable + (image->callCount * 2))));
|
||||
(padWord(reinterpret_cast<uintptr_t>(callTable + (image->callCount * 2))));
|
||||
unsigned heapMapSizeInWords = ceiling
|
||||
(heapMapSize(image->heapSize), BytesPerWord);
|
||||
uintptr_t* heap = heapMap + heapMapSizeInWords;
|
||||
|
Loading…
Reference in New Issue
Block a user