mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +00:00
fix regression in static field offset calculation
One of the changes in commit 5b4f179
broke this calculation.
This commit is contained in:
parent
0372d999d3
commit
4e4d109787
@ -496,8 +496,10 @@ makeCodeImage(Thread* t, Zone* zone, BootImage* image, uint8_t* code,
|
||||
}
|
||||
|
||||
if (fieldFlags(t, field) & ACC_STATIC) {
|
||||
while (targetStaticOffset % targetSize) {
|
||||
++ targetStaticOffset;
|
||||
unsigned excess = (targetStaticOffset % targetSize)
|
||||
% TargetBytesPerWord;
|
||||
if (excess) {
|
||||
targetStaticOffset += TargetBytesPerWord - excess;
|
||||
}
|
||||
|
||||
buildStaticOffset = fieldOffset(t, field);
|
||||
|
@ -1145,8 +1145,9 @@ parseFieldTable(Thread* t, Stream& s, object class_, object pool)
|
||||
|
||||
unsigned size = fieldSize(t, code);
|
||||
if (flags & ACC_STATIC) {
|
||||
while (staticOffset % size) {
|
||||
++ staticOffset;
|
||||
unsigned excess = (staticOffset % size) % BytesPerWord;
|
||||
if (excess) {
|
||||
staticOffset += BytesPerWord - excess;
|
||||
}
|
||||
|
||||
fieldOffset(t, field) = staticOffset;
|
||||
|
Loading…
Reference in New Issue
Block a user