Skip to content

Commit 30ed97c

Browse files
Fix several typos and fix bh_log calculate mills (#3441)
1 parent 0ceffe7 commit 30ed97c

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

core/iwasm/compilation/aot_llvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ create_memory_info(const AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
12041204
func_ctx->mem_space_unchanged = mem_space_unchanged;
12051205

12061206
memory_count = module->memory_count + module->import_memory_count;
1207-
/* If the module dosen't have memory, reserve
1207+
/* If the module doesn't have memory, reserve
12081208
one mem_info space with empty content */
12091209
if (memory_count == 0)
12101210
memory_count = 1;

core/iwasm/interpreter/wasm_runtime.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2364,12 +2364,11 @@ wasm_instantiate(WASMModule *module, WASMModuleInstance *parent,
23642364
(uint64)memory->num_bytes_per_page * memory->cur_page_count;
23652365
bh_assert(memory_data || memory_size == 0);
23662366

2367-
bh_assert(
2368-
data_seg->base_offset.init_expr_type == INIT_EXPR_TYPE_GET_GLOBAL
2369-
|| (data_seg->base_offset.init_expr_type == INIT_EXPR_TYPE_I32_CONST
2370-
&& !memory->is_memory64)
2371-
|| (data_seg->base_offset.init_expr_type == INIT_EXPR_TYPE_I64_CONST
2372-
&& memory->is_memory64));
2367+
bh_assert(data_seg->base_offset.init_expr_type
2368+
== INIT_EXPR_TYPE_GET_GLOBAL
2369+
|| data_seg->base_offset.init_expr_type
2370+
== (memory->is_memory64 ? INIT_EXPR_TYPE_I64_CONST
2371+
: INIT_EXPR_TYPE_I32_CONST));
23732372

23742373
if (data_seg->base_offset.init_expr_type == INIT_EXPR_TYPE_GET_GLOBAL) {
23752374
if (!check_global_init_expr(module,

core/shared/utils/bh_log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ bh_log(LogLevel log_level, const char *file, int line, const char *fmt, ...)
3838
t = t % (60 * 60);
3939
m = t / 60;
4040
s = t % 60;
41-
mills = (uint32)(usec % 1000);
41+
mills = (uint32)((usec % 1000000) / 1000);
4242

4343
snprintf(buf, sizeof(buf),
4444
"%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ":%03" PRIu32, h, m, s,

0 commit comments

Comments
 (0)