Skip to content

Commit 07ec609

Browse files
committed
Refactor: use LEB128 in update module
1 parent c22aa59 commit 07ec609

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/DebugBridges/AbstractDebugBridge.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,7 @@ export abstract class AbstractDebugBridge implements DebugBridge {
309309

310310
updateModule(wasm: Buffer): void {
311311
const w = new Uint8Array(wasm);
312-
const sizeBuffer = Buffer.allocUnsafe(4);
313-
sizeBuffer.writeUint32BE(w.length);
314-
const sizeHex = sizeBuffer.toString("hex");
312+
const sizeHex: string = convertToLEB128(w.length);
315313
const wasmHex = Buffer.from(w).toString("hex");
316314
let command = `${InterruptTypes.interruptUPDATEMod}${sizeHex}${wasmHex} \n`;
317315
console.log("Plugin: send Update module command");

0 commit comments

Comments
 (0)