Restructure uleb128

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

12
asm.js
View File

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