@@ 10,7 10,7 @@ fn readuleb128(in: []u8) ((uleb128, size) | partialread) = {
const byte = in[i];
let bits: uleb128 = byte & 0x7f;
result |= bits << shift;
- if (byte & 0x80 == 0)
+ if (byte&0x80 == 0)
return (result, i+1);
shift += 7;
};
@@ 21,7 21,6 @@ fn readuleb128(in: []u8) ((uleb128, size) | partialread) = {
// number of bytes used from the input.
fn readsleb128(in: []u8) ((sleb128, size) | partialread) = {
let result = 0u;
- let sign = 0u8;
let shift = 0u;
for (let i = 0z; i < len(in); i += 1) {
@@ 30,10 29,10 @@ fn readsleb128(in: []u8) ((sleb128, size) | partialread) = {
let bits: uint = byte & 0x7f;
result |= bits << shift;
- sign = byte & 0x40;
+ const neg = byte & 0x40 == 0x40;
shift += 7;
- if (byte & 0x80 == 0) {
- if (sign == 0x40)
+ if (byte&0x80 == 0) {
+ if (byte&0x40 == 0x40)
result |= ~((1u << shift)-1);
return (result: sleb128, i+1);
};