Skip to content

Commit 152fdb4

Browse files
authored
Allow access to status message from a child context. (#165)
Previously, proxy_get_status() would return status message only when it was called from the root context, which doesn't work when the effective context is automatically changed to the calling context as part of the SDK. With this change, status can be accessed from either root or child context. Signed-off-by: Piotr Sikora <[email protected]>
1 parent 21af4d7 commit 152fdb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/exports.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Word get_configuration(void *raw_context, Word value_ptr_ptr, Word value_size_pt
130130
}
131131

132132
Word get_status(void *raw_context, Word code_ptr, Word value_ptr_ptr, Word value_size_ptr) {
133-
auto context = WASM_CONTEXT(raw_context);
133+
auto context = WASM_CONTEXT(raw_context)->root_context();
134134
auto status = context->getStatus();
135135
if (!context->wasm()->setDatatype(code_ptr, status.first)) {
136136
return WasmResult::InvalidMemoryAccess;

0 commit comments

Comments
 (0)