Restructure uleb128

This commit is contained in:
2026-03-15 13:41:39 +00:00
parent 7099ca34a3
commit 7135eeba74

10
asm.js
View File

@@ -1156,13 +1156,15 @@ export class Assembler {
uleb128(x) {
const bytes = [];
do {
while (true) {
const b = x & 0x7f;
x >>= 7;
if (x != 0)
b |= 0x80;
if (x == 0) {
bytes.push(b);
} while (x != 0);
return bytes;
}
bytes.push(b | 0x80);
}
return bytes;
}