Skip to content

Commit

Permalink
Fix growToHold() bug in serializer.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Apr 14, 2013
1 parent 939c511 commit 073363c
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -709,9 +709,13 @@ private void serializeContext(CallFrame cf) {
/* Grows a buffer as needed to hold more data. */
private void growToHold(int idx, int required) {
ByteBuffer check = this.outputs[idx];
if (check.position() + required >= check.capacity()) {
int position = check.position();
if (position + required >= check.capacity()) {
ByteBuffer replacement = ByteBuffer.allocate(check.capacity() * 2);
replacement.order(ByteOrder.LITTLE_ENDIAN);
check.position(0);
replacement.put(check);
replacement.position(position);
this.outputs[idx] = replacement;
}
}
Expand Down

0 comments on commit 073363c

Please sign in to comment.