diff --git a/asm.js b/asm.js index 4128148..7db3575 100644 --- a/asm.js +++ b/asm.js @@ -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; - bytes.push(b); - } while (x != 0); + if (x == 0) { + bytes.push(b); + return bytes; + } + bytes.push(b | 0x80); + } return bytes; }