Skip to content

Commit f061180

Browse files
committed
[ZipPlugin] fix readStreamSize vs writeStreamSize ...
... as per VMMaker.oscog-mt.3135 and VMMaker.oscog-mt.3136
1 parent e367357 commit f061180

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎plugins/ZipPlugin.js‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
from
55
DeflatePlugin VMMaker-bf.353 uuid: 8ae25e7e-8d2c-451e-8277-598b30e9c002
66
*/
7+
/*
8+
Manual fixes:
9+
2022-01-15 VMMaker.oscog-mt.3135 and VMMaker.oscog-mt.3136
10+
*/
711

812
(function ZipPlugin() {
913
"use strict";
@@ -260,7 +264,7 @@ function deflateBlockchainLengthgoodMatch(lastIndex, chainLength, goodMatch) {
260264
}
261265

262266

263-
/* Determine the inst size of the class above DeflateStream by
267+
/* Determine the inst size of the class above InflateStream by
264268
looking for the first class whose inst size is less than 13. */
265269

266270
function determineSizeOfReadStream(rcvr) {
@@ -540,8 +544,8 @@ function loadZipEncoderFrom(rcvr) {
540544
/* zipWriteLimit := interpreterProxy fetchInteger: 3 ofObject: rcvr. */
541545

542546
zipReadLimit = interpreterProxy.fetchIntegerofObject(2, rcvr);
543-
zipBitBuf = interpreterProxy.fetchIntegerofObject(writeStreamInstSize + 1, rcvr);
544-
zipBitPos = interpreterProxy.fetchIntegerofObject(writeStreamInstSize + 2, rcvr);
547+
zipBitBuf = interpreterProxy.fetchIntegerofObject(writeStreamInstSize + 0, rcvr);
548+
zipBitPos = interpreterProxy.fetchIntegerofObject(writeStreamInstSize + 1, rcvr);
545549
return !interpreterProxy.failed();
546550
}
547551

@@ -853,8 +857,8 @@ function primitiveZipSendBlock() {
853857
result = sendBlockwithwithwith(litStream, distStream, litTree, distTree);
854858
if (!interpreterProxy.failed()) {
855859
interpreterProxy.storeIntegerofObjectwithValue(1, rcvr, zipPosition);
856-
interpreterProxy.storeIntegerofObjectwithValue(readStreamInstSize + 1, rcvr, zipBitBuf);
857-
interpreterProxy.storeIntegerofObjectwithValue(readStreamInstSize + 2, rcvr, zipBitPos);
860+
interpreterProxy.storeIntegerofObjectwithValue(writeStreamInstSize + 0, rcvr, zipBitBuf);
861+
interpreterProxy.storeIntegerofObjectwithValue(writeStreamInstSize + 1, rcvr, zipBitPos);
858862
}
859863
if (!interpreterProxy.failed()) {
860864
interpreterProxy.pop(5);

0 commit comments

Comments
 (0)