calio / lua-capnproto

Lua-capnp is a pure lua implementation of capnproto based on luajit.
BSD 2-Clause "Simplified" License
70 stars 24 forks source link

Fixed offset calculation for negative offset values. #7

Closed quark-tekliner closed 9 years ago

quark-tekliner commented 9 years ago

Arshift should be used instead of rshift for calculation signed values like offsets to prevent sign losing. As far as i know there are only two places where signed values are used: in list and structure pointer parsing.

calio commented 9 years ago

It seems arshift should be used. Thanks for your patch!

quark-tekliner commented 9 years ago

@calio do you plan push the patched version into rocks repository?

calio commented 9 years ago

Yes, but not now. Need to add a few tests for this to make a new release.