summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Nieves <christian@nieves.io>2024-05-14 11:05:02 -0500
committerGitHub <noreply@github.com>2024-05-14 16:05:02 +0000
commitd1e54a842c8f3fce4509e2f8f8db21b4d3317a66 (patch)
treecde9853f87376173af71f991e0a4bb969df3d3ec
parentc24a216237e2731cc71885230bf7de5a9dfac5c7 (diff)
downloadwabt-d1e54a842c8f3fce4509e2f8f8db21b4d3317a66.tar.gz
wabt-d1e54a842c8f3fce4509e2f8f8db21b4d3317a66.tar.bz2
wabt-d1e54a842c8f3fce4509e2f8f8db21b4d3317a66.zip
Fix bug in wasm2c's tail-call optimization code generation (#2420)
-rw-r--r--src/c-writer.cc2
-rw-r--r--test/wasm2c/tail-calls.txt2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/c-writer.cc b/src/c-writer.cc
index d7a61f42..9b92cb82 100644
--- a/src/c-writer.cc
+++ b/src/c-writer.cc
@@ -1858,7 +1858,7 @@ void CWriter::WriteTailCallWeakImports() {
Index num_results = func.GetNumResults();
if (num_params >= 1) {
Write(func.decl.sig.param_types, " params;", Newline());
- Write("wasm_rt_memcpy(params, tail_call_stack, sizeof(params);",
+ Write("wasm_rt_memcpy(params, tail_call_stack, sizeof(params));",
Newline());
}
diff --git a/test/wasm2c/tail-calls.txt b/test/wasm2c/tail-calls.txt
index fe9815e3..b2ee451b 100644
--- a/test/wasm2c/tail-calls.txt
+++ b/test/wasm2c/tail-calls.txt
@@ -766,7 +766,7 @@ WEAK_FUNC_DECL(wasm_tailcall_w2c_spectest_print_i32_f32, wasm_fallback_test_w2c_
{
next->fn = NULL;
struct wasm_multi_if params;
- wasm_rt_memcpy(params, tail_call_stack, sizeof(params);
+ wasm_rt_memcpy(params, tail_call_stack, sizeof(params));
w2c_spectest_print_i32_f32(*instance_ptr, params.i0, params.f1);
}