Skip to content

Commit 8e60feb

Browse files
Collective fix for typos and minor bugs (#4369)
1 parent 0343aaf commit 8e60feb

File tree

10 files changed

+28
-18
lines changed

10 files changed

+28
-18
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@
497497
- wasm loader: Fix handling if block without op else (#3404)
498498
- ref-types: Correct default value for function local variables (#3397)
499499
- aot compiler: Fix the length type passed to aot_memmove/aot_memset (#3378)
500-
- Fix loader and mini-loader select potiential error (#3374)
500+
- Fix loader and mini-loader select potential error (#3374)
501501
- Fix aot debugger compilation error on windows (#3370)
502502
- A few native stack detection fixes for macOS/arm64 (#3368)
503503
- Fix ESP32-S3 compiling error (#3359)

core/iwasm/common/gc/gc_type.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ wasm_reftype_is_subtype_of(uint8 type1, const WASMRefType *ref_type1,
11451145
return true;
11461146
else {
11471147
int32 heap_type = ref_type1->ref_ht_common.heap_type;
1148-
// We dont care whether type2 is nullable or not. So
1148+
// We don't care whether type2 is nullable or not. So
11491149
// we normalize it into its related one-byte type.
11501150
if (type2 == REF_TYPE_HT_NULLABLE
11511151
|| type2 == REF_TYPE_HT_NON_NULLABLE) {

core/iwasm/interpreter/wasm_loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3712,7 +3712,7 @@ load_function_section(const uint8 *buf, const uint8 *buf_end,
37123712
* we shall make a copy of code body [p_code, p_code + code_size]
37133713
* when we are worrying about inappropriate releasing behaviour.
37143714
* all code bodies are actually in a buffer which user allocates in
3715-
* his embedding environment and we don't have power on them.
3715+
* their embedding environment and we don't have power over them.
37163716
* it will be like:
37173717
* code_body_cp = malloc(code_size);
37183718
* memcpy(code_body_cp, p_code, code_size);

core/iwasm/interpreter/wasm_mini_loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ load_function_section(const uint8 *buf, const uint8 *buf_end,
12261226
* we shall make a copy of code body [p_code, p_code + code_size]
12271227
* when we are worrying about inappropriate releasing behaviour.
12281228
* all code bodies are actually in a buffer which user allocates in
1229-
* his embedding environment and we don't have power on them.
1229+
* their embedding environment and we don't have power over them.
12301230
* it will be like:
12311231
* code_body_cp = malloc(code_size);
12321232
* memcpy(code_body_cp, p_code, code_size);

core/iwasm/libraries/debug-engine/debug_engine.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ wasm_debug_instance_get_obj_mem(WASMDebugInstance *instance, uint64 offset,
743743
module_inst = (WASMModuleInstance *)exec_env->module_inst;
744744

745745
if (offset + *size > module_inst->module->load_size) {
746-
LOG_VERBOSE("wasm_debug_instance_get_data_mem size over flow!\n");
746+
LOG_VERBOSE("wasm_debug_instance_get_data_mem size overflow!\n");
747747
*size = module_inst->module->load_size >= offset
748748
? module_inst->module->load_size - offset
749749
: 0;
@@ -797,7 +797,7 @@ wasm_debug_instance_get_linear_mem(WASMDebugInstance *instance, uint64 offset,
797797
num_bytes_per_page = memory->num_bytes_per_page;
798798
linear_mem_size = num_bytes_per_page * memory->cur_page_count;
799799
if (offset + *size > linear_mem_size) {
800-
LOG_VERBOSE("wasm_debug_instance_get_linear_mem size over flow!\n");
800+
LOG_VERBOSE("wasm_debug_instance_get_linear_mem size overflow!\n");
801801
*size = linear_mem_size >= offset ? linear_mem_size - offset : 0;
802802
}
803803
bh_memcpy_s(buf, (uint32)*size, memory->memory_data + offset,
@@ -830,7 +830,7 @@ wasm_debug_instance_set_linear_mem(WASMDebugInstance *instance, uint64 offset,
830830
num_bytes_per_page = memory->num_bytes_per_page;
831831
linear_mem_size = num_bytes_per_page * memory->cur_page_count;
832832
if (offset + *size > linear_mem_size) {
833-
LOG_VERBOSE("wasm_debug_instance_get_linear_mem size over flow!\n");
833+
LOG_VERBOSE("wasm_debug_instance_get_linear_mem size overflow!\n");
834834
*size = linear_mem_size >= offset ? linear_mem_size - offset : 0;
835835
}
836836
bh_memcpy_s(memory->memory_data + offset, (uint32)*size, buf,

core/shared/platform/esp-idf/espidf_platform.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,20 @@ openat(int fd, const char *pathname, int flags, ...)
201201
int ret;
202202
char dir_path[DIR_PATH_LEN];
203203
char *full_path;
204+
mode_t mode = 0;
205+
bool has_mode = false;
206+
207+
if (flags & O_CREAT) {
208+
va_list ap;
209+
va_start(ap, flags);
210+
mode = (mode_t)va_arg(ap, int);
211+
va_end(ap);
212+
has_mode = true;
213+
}
204214

205215
ret = fcntl(fd, F_GETPATH, dir_path);
206216
if (ret != 0) {
207-
errno = -EINVAL;
217+
errno = EINVAL;
208218
return -1;
209219
}
210220

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

217-
new_fd = open(full_path, flags);
227+
new_fd = has_mode ? open(full_path, flags, mode) : open(full_path, flags);
218228
free(full_path);
219229

220230
return new_fd;

language-bindings/python/wamr-api/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
### Pre-requisites
88
#### Install requirements
9-
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:
9+
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:
1010

1111

1212
```shell

language-bindings/python/wasm-c-api/docs/design.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,12 @@ writable and needs to be copied into a ctype array.
353353

354354
#### variable arguments
355355

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

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

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

374374
### bindgen.py
375375

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

product-mini/platforms/linux-sgx/enclave-sample/App/pal_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ struct wamr_pal_create_process_args {
7979
// Untrusted environment variable array pass to new process.
8080
//
8181
// The untrusted env vars to the command. And the last element of the array
82-
// must be NULL to indicate the length of array.
82+
// must be NULL to indicate the end of the array.
8383
//
8484
// Optional field.
8585
const char **env;

tests/unit/memory64/memory64_atomic_test.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class memory64_atomic_test_suite : public testing::TestWithParam<RunningMode>
6060
return false;
6161
}
6262

63-
void destory_exec_env()
63+
void destroy_exec_env()
6464
{
6565
wasm_runtime_destroy_exec_env(exec_env);
6666
wasm_runtime_deinstantiate(module_inst);
@@ -109,7 +109,7 @@ class memory64_atomic_test_suite : public testing::TestWithParam<RunningMode>
109109
virtual void TearDown()
110110
{
111111
if (cleanup) {
112-
destory_exec_env();
112+
destroy_exec_env();
113113
wasm_runtime_destroy();
114114
cleanup = false;
115115
}
@@ -339,8 +339,8 @@ TEST_P(memory64_atomic_test_suite, atomic_opcodes_i64_rmw_cmpxchg)
339339
PUT_I64_TO_ADDR(wasm_argv + 2, 0x100F0E0D0C0B0A09);
340340
// new
341341
PUT_I64_TO_ADDR(wasm_argv + 4, 0xdeadcafebeefdead);
342-
ASSERT_TRUE(wasm_runtime_call_wasm(exec_env, func_map["i64_atomic_rmw_cmpxchg"],
343-
6, wasm_argv));
342+
ASSERT_TRUE(wasm_runtime_call_wasm(
343+
exec_env, func_map["i64_atomic_rmw_cmpxchg"], 6, wasm_argv));
344344
i64 = 0x100F0E0D0C0B0A09;
345345
ASSERT_EQ(i64, GET_U64_FROM_ADDR(wasm_argv));
346346

0 commit comments

Comments
 (0)