libmir / mir-ion

Ion, JSON, YAML, CSV, CBOR and Msgpack serialization framework
Apache License 2.0
14 stars 6 forks source link

Potential broken statement in deserializer #37

Closed WebFreak001 closed 1 year ago

WebFreak001 commented 1 year ago

I came across this while looking through the code, I didn't have any actual issue with this yet, but it seems to be hard to come across because of the extra UDA you would need to even enable this code path.

https://github.com/libmir/mir-ion/blob/a5499d4aca785c82205926e3d025762d78b6722b/source/mir/deser/package.d#L856

this assignment seems to be done in the default case, but 1) it's missing a break; if it's intended to go out of the switch 2) if that's the intended way, the ionValue is overriden right afterwards below, (line 863) so this assigned ionValue actually can't be used.

this might be missing a test case?

9il commented 1 year ago

Thank you for the bug report. Fixed in v2.1.3