AluVM / rust-aluvm

Rust implementation of AluVM (RISC functional machine)
https://docs.rs/aluvm
Apache License 2.0
58 stars 22 forks source link

Cursor doesn't read accross bytes #86

Closed 6293 closed 1 year ago

6293 commented 1 year ago

https://github.com/AluVM/rust-aluvm/blob/eb4fcc41c5f01bbba1d9b6494227f0d9096429c0/src/isa/bytecode.rs#L950-L955

Here, reg spans across 2 bytes (last bit of first byte to third bit of second byte). write_u4, however, does not handle such cases https://github.com/AluVM/rust-aluvm/blob/866f9c8abd409578b8c34e047f581919dd800517/src/library/cursor.rs#L129

dr-orlovsky commented 1 year ago

Very good point. I think this may be also the case for other serialization

6293 commented 1 year ago

Here is our current rule: