| 38 | } |
| 39 | |
| 40 | uint64_t readLEB128(const uint8_t*& current, const uint8_t* end) |
| 41 | { |
| 42 | uint64_t result = 0; |
| 43 | int bit = 0; |
| 44 | do |
| 45 | { |
| 46 | if (current >= end) |
| 47 | return -1; |
| 48 | |
| 49 | uint64_t slice = *current & 0x7f; |
| 50 | |
| 51 | if (bit > 63) |
| 52 | return -1; |
| 53 | result |= (slice << bit); |
| 54 | bit += 7; |
| 55 | } while (*current++ & 0x80); |
| 56 | return result; |
| 57 | } |
| 58 | |
| 59 | |
| 60 | uint64_t readValidULEB128(const uint8_t*& current, const uint8_t* end) |
no outgoing calls
no test coverage detected