Skip to content

Commit

Permalink
Merge pull request envoyproxy#143 from kyessenov/wasm_ff
Browse files Browse the repository at this point in the history
Return the foreign function result.
  • Loading branch information
kyessenov authored Feb 7, 2020
2 parents 892453e + ba2ffa8 commit 5c68a90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/extensions/common/wasm/exports.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Word call_foreign_function(void* raw_context, Word function_name, Word function_
uint64_t address = 0;
void* result = nullptr;
size_t result_size = 0;
f(wasm, args, [&wasm, &address, &result, &result_size](size_t s) -> void* {
auto res = f(wasm, args, [&wasm, &address, &result, &result_size](size_t s) -> void* {
result = wasm.allocMemory(s, &address);
result_size = s;
return result;
Expand All @@ -248,7 +248,7 @@ Word call_foreign_function(void* raw_context, Word function_name, Word function_
if (!context->wasmVm()->setWord(results_size.u64_, Word(result_size))) {
return wasmResultToWord(WasmResult::InvalidMemoryAccess);
}
return wasmResultToWord(WasmResult::Ok);
return wasmResultToWord(res);
}

Word clear_route_cache(void* raw_context) {
Expand Down

0 comments on commit 5c68a90

Please sign in to comment.