From 5b6066b54e03e19ec4c4d2b22550ff081e46f6e6 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Mon, 10 Jan 2022 09:37:16 +0100 Subject: [PATCH] Fix off-by-one error in DeflatePlugin. Thanks to @fmateoc for pointing this out! See http://lists.squeakfoundation.org/pipermail/vm-dev/2022-January/037536.html --- .../src/de/hpi/swa/trufflesqueak/nodes/plugins/Zip.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/Zip.java b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/Zip.java index 8ddcfe9e4..840f600c1 100644 --- a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/Zip.java +++ b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/Zip.java @@ -579,12 +579,12 @@ public long primitiveZipSendBlock(final PointersObject rcvr, final PointersObjec zipPosition = fetchIntegerofObject(1, rcvr); /* zipWriteLimit := interpreterProxy fetchInteger: 3 ofObject: rcvr. */ zipReadLimit = fetchIntegerofObject(2, rcvr); - zipBitBuf = fetchIntegerofObject(writeStreamInstSize + 1, rcvr); - zipBitPos = fetchIntegerofObject(writeStreamInstSize + 2, rcvr); + zipBitBuf = fetchIntegerofObject(writeStreamInstSize + 0, rcvr); + zipBitPos = fetchIntegerofObject(writeStreamInstSize + 1, rcvr); final long result = sendBlockwithwithwith(litStream, distStream, litTree, distTree); storeIntegerofObjectwithValue(1, rcvr, zipPosition); - storeIntegerofObjectwithValue(readStreamInstSize + 1, rcvr, zipBitBuf); - storeIntegerofObjectwithValue(readStreamInstSize + 2, rcvr, zipBitPos); + storeIntegerofObjectwithValue(writeStreamInstSize + 0, rcvr, zipBitBuf); + storeIntegerofObjectwithValue(writeStreamInstSize + 1, rcvr, zipBitPos); return result; }