Encode section lengths with unsigned LEB128
This commit is contained in:
4
asm.js
4
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));
|
||||
|
||||
Reference in New Issue
Block a user