fix a few more bugs
This commit is contained in:
parent
26942d46c8
commit
fb239f612f
2 changed files with 12 additions and 12 deletions
|
@ -54,7 +54,7 @@ class EncodingSuite extends FunSuite {
|
||||||
|
|
||||||
allTypes2.setStructField(allTypes.asReader());
|
allTypes2.setStructField(allTypes.asReader());
|
||||||
val reader = allTypes2.asReader().getStructField();
|
val reader = allTypes2.asReader().getStructField();
|
||||||
//TestUtil.checkTestMessage(reader);
|
TestUtil.checkTestMessage(reader);
|
||||||
}
|
}
|
||||||
|
|
||||||
test("Defaults") {
|
test("Defaults") {
|
||||||
|
|
|
@ -536,7 +536,7 @@ final class WireHelpers {
|
||||||
ListPointer.set(allocation.segment.buffer, allocation.refOffset, ElementSize.POINTER, value.elementCount);
|
ListPointer.set(allocation.segment.buffer, allocation.refOffset, ElementSize.POINTER, value.elementCount);
|
||||||
for (int i = 0; i < value.elementCount; ++i) {
|
for (int i = 0; i < value.elementCount; ++i) {
|
||||||
copyPointer(allocation.segment, allocation.ptr + i,
|
copyPointer(allocation.segment, allocation.ptr + i,
|
||||||
value.segment, value.ptr + i, value.nestingLimit);
|
value.segment, value.ptr / Constants.BYTES_PER_WORD + i, value.nestingLimit);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//# List of data.
|
//# List of data.
|
||||||
|
@ -554,7 +554,7 @@ final class WireHelpers {
|
||||||
|
|
||||||
ListPointer.set(allocation.segment.buffer, allocation.refOffset, elementSize, value.elementCount);
|
ListPointer.set(allocation.segment.buffer, allocation.refOffset, elementSize, value.elementCount);
|
||||||
memcpy(allocation.segment.buffer, allocation.ptr * Constants.BYTES_PER_WORD,
|
memcpy(allocation.segment.buffer, allocation.ptr * Constants.BYTES_PER_WORD,
|
||||||
value.segment.buffer, value.ptr * 8, totalSize * Constants.BYTES_PER_WORD);
|
value.segment.buffer, value.ptr, totalSize * Constants.BYTES_PER_WORD);
|
||||||
}
|
}
|
||||||
return allocation.segment;
|
return allocation.segment;
|
||||||
} else {
|
} else {
|
||||||
|
@ -570,7 +570,7 @@ final class WireHelpers {
|
||||||
dataSize, pointerCount);
|
dataSize, pointerCount);
|
||||||
|
|
||||||
int dstOffset = allocation.ptr + Constants.POINTER_SIZE_IN_WORDS;
|
int dstOffset = allocation.ptr + Constants.POINTER_SIZE_IN_WORDS;
|
||||||
int srcOffset = value.ptr;
|
int srcOffset = value.ptr / Constants.BYTES_PER_WORD;
|
||||||
|
|
||||||
for (int i = 0; i < value.elementCount; ++i) {
|
for (int i = 0; i < value.elementCount; ++i) {
|
||||||
memcpy(allocation.segment.buffer, dstOffset * Constants.BYTES_PER_WORD,
|
memcpy(allocation.segment.buffer, dstOffset * Constants.BYTES_PER_WORD,
|
||||||
|
@ -623,7 +623,7 @@ final class WireHelpers {
|
||||||
resolved.segment.arena.checkReadLimit(StructPointer.wordSize(resolved.ref));
|
resolved.segment.arena.checkReadLimit(StructPointer.wordSize(resolved.ref));
|
||||||
return setStructPointer(dstSegment, dstOffset,
|
return setStructPointer(dstSegment, dstOffset,
|
||||||
new StructReader(resolved.segment,
|
new StructReader(resolved.segment,
|
||||||
resolved.ptr,
|
resolved.ptr * Constants.BYTES_PER_WORD,
|
||||||
resolved.ptr + StructPointer.dataSize(resolved.ref),
|
resolved.ptr + StructPointer.dataSize(resolved.ref),
|
||||||
StructPointer.dataSize(resolved.ref) * Constants.BITS_PER_WORD,
|
StructPointer.dataSize(resolved.ref) * Constants.BITS_PER_WORD,
|
||||||
StructPointer.ptrCount(resolved.ref),
|
StructPointer.ptrCount(resolved.ref),
|
||||||
|
@ -651,7 +651,7 @@ final class WireHelpers {
|
||||||
}
|
}
|
||||||
return setListPointer(dstSegment, dstOffset,
|
return setListPointer(dstSegment, dstOffset,
|
||||||
new ListReader(resolved.segment,
|
new ListReader(resolved.segment,
|
||||||
resolved.ptr,
|
ptr * Constants.BYTES_PER_WORD,
|
||||||
elementCount,
|
elementCount,
|
||||||
wordsPerElement * Constants.BITS_PER_WORD,
|
wordsPerElement * Constants.BITS_PER_WORD,
|
||||||
StructPointer.dataSize(tag) * Constants.BITS_PER_WORD,
|
StructPointer.dataSize(tag) * Constants.BITS_PER_WORD,
|
||||||
|
@ -668,7 +668,7 @@ final class WireHelpers {
|
||||||
|
|
||||||
return setListPointer(dstSegment, dstOffset,
|
return setListPointer(dstSegment, dstOffset,
|
||||||
new ListReader(resolved.segment,
|
new ListReader(resolved.segment,
|
||||||
resolved.ptr,
|
resolved.ptr * Constants.BYTES_PER_WORD,
|
||||||
elementCount,
|
elementCount,
|
||||||
step,
|
step,
|
||||||
dataSize,
|
dataSize,
|
||||||
|
|
Loading…
Reference in a new issue