I should have also mentioned that PNGReadWriterTest also has 18 failures for SqueakJS, and I think I remember them failing in TruffleSqueak as well

On Sun, Jan 9, 2022 at 10:18 PM Florin Mateoc <florin.mateoc@gmail.com> wrote:
Hi all, and Happy New Year!

I think I just found a couple of bugs in the DeflatePlugin. They were causing errors in my JsSqueak, I don't fully understand why they don't seem to cause problems in Squeak. Anyway, after I fixed them, the primitives work and the PNGReadWriterTest tests are all succeeding for me.

One is in #loadZipEncoderFrom:
The method checks and then determines the writeStreamInstSize and then fetches the bitBuffer and bitPosition (the first two instvars of ZipEncoder, a direct subclass of WriteStream) from offsets writeStreamInstSize + 1 and writeStreamInstSize + 2, although the fetches are 0-based

The other is in #primitiveZipSendBlock
The method, still working on a ZipEncoder, at the end stores the modified values for bitBuffer and bitPosition at offset readStreamInstSize + 1 and readStreamInstSize + 2, which is just wrong.

As I said, I don't quite get why this does not cause at least image-side errors if not VM crashes in Squeak, but they should probably be fixed anyway :)

All the best,
Florin