mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +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) {
|
if (fieldFlags(t, field) & ACC_STATIC) {
|
||||||
while (targetStaticOffset % targetSize) {
|
unsigned excess = (targetStaticOffset % targetSize)
|
||||||
++ targetStaticOffset;
|
% TargetBytesPerWord;
|
||||||
|
if (excess) {
|
||||||
|
targetStaticOffset += TargetBytesPerWord - excess;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildStaticOffset = fieldOffset(t, field);
|
buildStaticOffset = fieldOffset(t, field);
|
||||||
|
@ -1145,8 +1145,9 @@ parseFieldTable(Thread* t, Stream& s, object class_, object pool)
|
|||||||
|
|
||||||
unsigned size = fieldSize(t, code);
|
unsigned size = fieldSize(t, code);
|
||||||
if (flags & ACC_STATIC) {
|
if (flags & ACC_STATIC) {
|
||||||
while (staticOffset % size) {
|
unsigned excess = (staticOffset % size) % BytesPerWord;
|
||||||
++ staticOffset;
|
if (excess) {
|
||||||
|
staticOffset += BytesPerWord - excess;
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldOffset(t, field) = staticOffset;
|
fieldOffset(t, field) = staticOffset;
|
||||||
|
Loading…
Reference in New Issue
Block a user