diff --git a/asm.js b/asm.js index 6154f00..2266591 100644 --- a/asm.js +++ b/asm.js @@ -1327,7 +1327,9 @@ export class Assembler { ]; const sections = template.map(([ code, generator ]) => { const body = generator(); - return body == null ? [] : [ code, body.length, body ]; + if (body == null) + return []; + return [ code, this.uleb128(body.length), body ]; }); return new Uint8Array([ HEADER, sections ].flat(Infinity));