Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm][debugger] Fix reusing buffer for debugger #59773

Merged
merged 2 commits into from
Sep 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/mono/wasm/runtime/src/mono/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ function mono_wasm_malloc_and_set_debug_buffer(command_parameters: string) {
Module._free(_debugger_buffer);
_debugger_buffer_len = Math.max(command_parameters.length, _debugger_buffer_len, 256);
_debugger_buffer = Module._malloc(_debugger_buffer_len);
_debugger_heap_bytes = new Uint8Array(Module.HEAPU8.buffer, _debugger_buffer, _debugger_buffer_len);
}
//reset _debugger_heap_bytes because Module.HEAPU8.buffer can be reallocated
_debugger_heap_bytes = new Uint8Array(Module.HEAPU8.buffer, _debugger_buffer, _debugger_buffer_len);
_debugger_heap_bytes.set(_base64_to_uint8(command_parameters));
}

Expand Down