Skip to content

Commit 39e3c5b

Browse files
committed
Fixed random test error when using skip and encoding due to internal Buffer unsafeAlloc
1 parent 9c64d23 commit 39e3c5b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/binary_parser.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,7 @@ Parser.prototype.generateSkip = function(ctx) {
707707

708708
Parser.prototype.generate_encodeSkip = function(ctx) {
709709
var length = ctx.generateOption(this.options.length);
710-
ctx.pushCode("smartBuffer._ensureWriteable({0});", length);
711-
ctx.pushCode("smartBuffer.writeOffset += {0};", length);
710+
ctx.pushCode("smartBuffer.writeBuffer(Buffer.alloc({0}));", length);
712711
};
713712

714713
Parser.prototype.generateString = function(ctx) {

0 commit comments

Comments
 (0)