| 67 | |
| 68 | |
| 69 | static size_t loadUnsigned (LoadState *S, size_t limit) { |
| 70 | size_t x = 0; |
| 71 | int b; |
| 72 | limit >>= 7; |
| 73 | do { |
| 74 | b = loadByte(S); |
| 75 | if (x >= limit) |
| 76 | error(S, "integer overflow"); |
| 77 | x = (x << 7) | (b & 0x7f); |
| 78 | } while ((b & 0x80) == 0); |
| 79 | return x; |
| 80 | } |
| 81 | |
| 82 | |
| 83 | static size_t loadSize (LoadState *S) { |