[Vm-dev] bugs in DeflatePlugin?

Florin Mateoc florin.mateoc at gmail.com
Mon Jan 10 03:18:15 UTC 2022

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,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20220109/645f7560/attachment.html>

More information about the Vm-dev mailing list