From 7135eeba74f724083fb2ef0909dd5282cb4095cf Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Sun, 15 Mar 2026 13:41:39 +0000 Subject: [PATCH] Restructure uleb128 --- asm.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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; }