Gui-Yom / hlbc

Hashlink bytecode disassembler, analyzer, decompiler and assembler.
https://gui-yom.github.io/hlbc/
MIT License
51 stars 7 forks source link

Fix write_var bits #2

Closed turuslan closed 8 months ago

turuslan commented 8 months ago

Thank you for making this project.

Copy-paste typo, "|" wasn't replaced with "&", so all bits were set to ones instead of masking them. deserialize(serialize(bytecode)) failed for that reason.

Gui-Yom commented 8 months ago

Indeed, it does not make much sense to OR with 0xFF. Thank you. For reference : https://github.com/HaxeFoundation/haxe/blob/613b0291c4976a8169aa643cdcc408c7d6b69da9/src/generators/genhl.ml#L3698