| 163 | |
| 164 | |
| 165 | static uint64_t readLEB128(DataBuffer& p, size_t end, size_t &offset) |
| 166 | { |
| 167 | uint64_t result = 0; |
| 168 | int bit = 0; |
| 169 | do { |
| 170 | if (offset >= end) |
| 171 | return -1; |
| 172 | |
| 173 | uint64_t slice = p[offset] & 0x7f; |
| 174 | |
| 175 | if (bit > 63) |
| 176 | return -1; |
| 177 | else { |
| 178 | result |= (slice << bit); |
| 179 | bit += 7; |
| 180 | } |
| 181 | } while (p[offset++] & 0x80); |
| 182 | return result; |
| 183 | } |
| 184 | |
| 185 | |
| 186 | uint64_t readValidULEB128(DataBuffer& buffer, size_t& cursor) |
no outgoing calls
no test coverage detected