gogen-avro icon indicating copy to clipboard operation
gogen-avro copied to clipboard

Fix skipping map and array fields that are missing in the reader schema

Open anekdoti opened this issue 5 months ago • 0 comments

This PR fixes https://github.com/actgardner/gogen-avro/issues/207.

Previously, the code, generated by the compiler, tried to set the hint size on the target even when the (array or map) data was actually skipped because of a field in the writer schema missing in the reader schema. The bugfix adds a parameter to the methods generating the VM code for block entry and exit that removes the hint size operation if the reader schema is nil. Jumps are adjusted accordingly as well. A new test under test/array-removed was added that failed previously.

Thank you, @tomasfabian, for your hints!

anekdoti avatar Sep 13 '24 14:09 anekdoti