Skip to content

Collective fix for typos and minor bugs #4369

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

Merged
merged 3 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@
- wasm loader: Fix handling if block without op else (#3404)
- ref-types: Correct default value for function local variables (#3397)
- aot compiler: Fix the length type passed to aot_memmove/aot_memset (#3378)
- Fix loader and mini-loader select potiential error (#3374)
- Fix loader and mini-loader select potential error (#3374)
- Fix aot debugger compilation error on windows (#3370)
- A few native stack detection fixes for macOS/arm64 (#3368)
- Fix ESP32-S3 compiling error (#3359)
Expand Down
2 changes: 1 addition & 1 deletion core/iwasm/common/gc/gc_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ wasm_reftype_is_subtype_of(uint8 type1, const WASMRefType *ref_type1,
return true;
else {
int32 heap_type = ref_type1->ref_ht_common.heap_type;
// We dont care whether type2 is nullable or not. So
// We don't care whether type2 is nullable or not. So
// we normalize it into its related one-byte type.
if (type2 == REF_TYPE_HT_NULLABLE
|| type2 == REF_TYPE_HT_NON_NULLABLE) {
Expand Down
2 changes: 1 addition & 1 deletion core/iwasm/interpreter/wasm_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -3712,7 +3712,7 @@ load_function_section(const uint8 *buf, const uint8 *buf_end,
* we shall make a copy of code body [p_code, p_code + code_size]
* when we are worrying about inappropriate releasing behaviour.
* all code bodies are actually in a buffer which user allocates in
* his embedding environment and we don't have power on them.
* their embedding environment and we don't have power over them.
* it will be like:
* code_body_cp = malloc(code_size);
* memcpy(code_body_cp, p_code, code_size);
Expand Down
2 changes: 1 addition & 1 deletion core/iwasm/interpreter/wasm_mini_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ load_function_section(const uint8 *buf, const uint8 *buf_end,
* we shall make a copy of code body [p_code, p_code + code_size]
* when we are worrying about inappropriate releasing behaviour.
* all code bodies are actually in a buffer which user allocates in
* his embedding environment and we don't have power on them.
* their embedding environment and we don't have power over them.
* it will be like:
* code_body_cp = malloc(code_size);
* memcpy(code_body_cp, p_code, code_size);
Expand Down
6 changes: 3 additions & 3 deletions core/iwasm/libraries/debug-engine/debug_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ wasm_debug_instance_get_obj_mem(WASMDebugInstance *instance, uint64 offset,
module_inst = (WASMModuleInstance *)exec_env->module_inst;

if (offset + *size > module_inst->module->load_size) {
LOG_VERBOSE("wasm_debug_instance_get_data_mem size over flow!\n");
LOG_VERBOSE("wasm_debug_instance_get_data_mem size overflow!\n");
*size = module_inst->module->load_size >= offset
? module_inst->module->load_size - offset
: 0;
Expand Down Expand Up @@ -797,7 +797,7 @@ wasm_debug_instance_get_linear_mem(WASMDebugInstance *instance, uint64 offset,
num_bytes_per_page = memory->num_bytes_per_page;
linear_mem_size = num_bytes_per_page * memory->cur_page_count;
if (offset + *size > linear_mem_size) {
LOG_VERBOSE("wasm_debug_instance_get_linear_mem size over flow!\n");
LOG_VERBOSE("wasm_debug_instance_get_linear_mem size overflow!\n");
*size = linear_mem_size >= offset ? linear_mem_size - offset : 0;
}
bh_memcpy_s(buf, (uint32)*size, memory->memory_data + offset,
Expand Down Expand Up @@ -830,7 +830,7 @@ wasm_debug_instance_set_linear_mem(WASMDebugInstance *instance, uint64 offset,
num_bytes_per_page = memory->num_bytes_per_page;
linear_mem_size = num_bytes_per_page * memory->cur_page_count;
if (offset + *size > linear_mem_size) {
LOG_VERBOSE("wasm_debug_instance_get_linear_mem size over flow!\n");
LOG_VERBOSE("wasm_debug_instance_get_linear_mem size overflow!\n");
*size = linear_mem_size >= offset ? linear_mem_size - offset : 0;
}
bh_memcpy_s(memory->memory_data + offset, (uint32)*size, buf,
Expand Down
14 changes: 12 additions & 2 deletions core/shared/platform/esp-idf/espidf_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,20 @@ openat(int fd, const char *pathname, int flags, ...)
int ret;
char dir_path[DIR_PATH_LEN];
char *full_path;
mode_t mode = 0;
bool has_mode = false;

if (flags & O_CREAT) {
va_list ap;
va_start(ap, flags);
mode = (mode_t)va_arg(ap, int);
va_end(ap);
has_mode = true;
}

ret = fcntl(fd, F_GETPATH, dir_path);
if (ret != 0) {
errno = -EINVAL;
errno = EINVAL;
return -1;
}

Expand All @@ -214,7 +224,7 @@ openat(int fd, const char *pathname, int flags, ...)
return -1;
}

new_fd = open(full_path, flags);
new_fd = has_mode ? open(full_path, flags, mode) : open(full_path, flags);
free(full_path);

return new_fd;
Expand Down
2 changes: 1 addition & 1 deletion language-bindings/python/wamr-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### Pre-requisites
#### Install requirements
Before proceeding it is necessary to make sure your Python environment is correctly configured. To do ths open a terminal session in this directory and perfom the following:
Before proceeding it is necessary to make sure your Python environment is correctly configured. To do this open a terminal session in this directory and perform the following:


```shell
Expand Down
6 changes: 3 additions & 3 deletions language-bindings/python/wasm-c-api/docs/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,12 @@ writable and needs to be copied into a ctype array.

#### variable arguments

A function with _variable arugments_ makes it hard to specify the required
A function with _variable arguments_ makes it hard to specify the required
argument types for the function prototype. It leaves us one way to call it
directly without any arguments type checking.

```python
libc.printf(b"Hello, an int %d, a float %f, a string %s\n", c_int(1), c_doulbe(3.14), "World!")
libc.printf(b"Hello, an int %d, a float %f, a string %s\n", c_int(1), c_double(3.14), "World!")
```

#### Use `c_bool` to represent `wasm_mutability_t `
Expand All @@ -373,7 +373,7 @@ libc.printf(b"Hello, an int %d, a float %f, a string %s\n", c_int(1), c_doulbe(3

### bindgen.py

`bindge.py` is a tool to create WAMR python binding automatically. `binding.py`
`bindgen.py` is a tool to create WAMR python binding automatically. `binding.py`
is generated. We should avoid modification on it. Additional helpers should go
to `ffi.py`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct wamr_pal_create_process_args {
// Untrusted environment variable array pass to new process.
//
// The untrusted env vars to the command. And the last element of the array
// must be NULL to indicate the length of array.
// must be NULL to indicate the end of the array.
//
// Optional field.
const char **env;
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/memory64/memory64_atomic_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class memory64_atomic_test_suite : public testing::TestWithParam<RunningMode>
return false;
}

void destory_exec_env()
void destroy_exec_env()
{
wasm_runtime_destroy_exec_env(exec_env);
wasm_runtime_deinstantiate(module_inst);
Expand Down Expand Up @@ -109,7 +109,7 @@ class memory64_atomic_test_suite : public testing::TestWithParam<RunningMode>
virtual void TearDown()
{
if (cleanup) {
destory_exec_env();
destroy_exec_env();
wasm_runtime_destroy();
cleanup = false;
}
Expand Down Expand Up @@ -339,8 +339,8 @@ TEST_P(memory64_atomic_test_suite, atomic_opcodes_i64_rmw_cmpxchg)
PUT_I64_TO_ADDR(wasm_argv + 2, 0x100F0E0D0C0B0A09);
// new
PUT_I64_TO_ADDR(wasm_argv + 4, 0xdeadcafebeefdead);
ASSERT_TRUE(wasm_runtime_call_wasm(exec_env, func_map["i64_atomic_rmw_cmpxchg"],
6, wasm_argv));
ASSERT_TRUE(wasm_runtime_call_wasm(
exec_env, func_map["i64_atomic_rmw_cmpxchg"], 6, wasm_argv));
i64 = 0x100F0E0D0C0B0A09;
ASSERT_EQ(i64, GET_U64_FROM_ADDR(wasm_argv));

Expand Down
Loading