Skip to content
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

Merge bytecodealliance:main into wenyongh:main #965

Merged
merged 6 commits into from
Nov 18, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.27.0
uses: github/codeql-action/init@v3.27.1
with:
languages: ${{ matrix.language }}

Expand All @@ -70,7 +70,7 @@ jobs:
- run: |
./.github/scripts/codeql_buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.27.0
uses: github/codeql-action/analyze@v3.27.1
with:
category: "/language:${{matrix.language}}"
upload: false
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif

- name: Upload CodeQL results to code scanning
uses: github/codeql-action/upload-sarif@v3.27.0
uses: github/codeql-action/upload-sarif@v3.27.1
with:
sarif_file: ${{ steps.step1.outputs.sarif-output }}
category: "/language:${{matrix.language}}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/supply_chain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@3aa71356c75a8edd8430d54dff2982203a28be45 # v2.2.4
uses: github/codeql-action/upload-sarif@acb9cb18eec7e3a113ef83cff0be91e75cfd9526 # v2.2.4
with:
sarif_file: results.sarif
3 changes: 2 additions & 1 deletion core/iwasm/common/wasm_application.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ execute_main(WASMModuleInstanceCommon *module_inst, int32 argc, char *argv[])
bool ret, is_import_func = true, is_memory64 = false;
#if WASM_ENABLE_MEMORY64 != 0
WASMModuleInstance *wasm_module_inst = (WASMModuleInstance *)module_inst;
is_memory64 = wasm_module_inst->memories[0]->is_memory64;
if (wasm_module_inst->memory_count > 0)
is_memory64 = wasm_module_inst->memories[0]->is_memory64;
#endif

exec_env = wasm_runtime_get_exec_env_singleton(module_inst);
Expand Down
2 changes: 1 addition & 1 deletion core/iwasm/compilation/aot_orc_extra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ LLVMOrcLLLazyJITBuilderSetJITTargetMachineBuilder(
LLVMOrcDisposeJITTargetMachineBuilder(JTMP);
}

static Optional<CompileOnDemandLayer::GlobalValueSet>
static Optional<GlobalValueSet>
PartitionFunction(GlobalValueSet Requested)
{
std::vector<const GlobalValue *> GVsToAdd;
Expand Down
22 changes: 13 additions & 9 deletions core/iwasm/interpreter/wasm_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -9885,13 +9885,6 @@ reserve_block_ret(WASMLoaderContext *loader_ctx, uint8 opcode,
}
#endif /* WASM_ENABLE_FAST_INTERP */

#define RESERVE_BLOCK_RET() \
do { \
if (!reserve_block_ret(loader_ctx, opcode, disable_emit, error_buf, \
error_buf_size)) \
goto fail; \
} while (0)

#define PUSH_TYPE(type) \
do { \
if (!(wasm_loader_push_frame_ref(loader_ctx, type, error_buf, \
Expand Down Expand Up @@ -11612,7 +11605,10 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
#if WASM_ENABLE_FAST_INTERP != 0
/* if the result of if branch is in local or const area, add a
* copy op */
RESERVE_BLOCK_RET();
if (!reserve_block_ret(loader_ctx, opcode, disable_emit,
error_buf, error_buf_size)) {
goto fail;
}

emit_empty_label_addr_and_frame_ip(PATCH_END);
apply_label_patch(loader_ctx, 1, PATCH_ELSE);
Expand Down Expand Up @@ -11672,7 +11668,15 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
#if WASM_ENABLE_FAST_INTERP != 0
skip_label();
/* copy the result to the block return address */
RESERVE_BLOCK_RET();
if (!reserve_block_ret(loader_ctx, opcode, disable_emit,
error_buf, error_buf_size)) {
/* it could be tmp frame_csp allocated from opcode like
* OP_BR and not counted in loader_ctx->csp_num, it won't
* be freed in wasm_loader_ctx_destroy(loader_ctx) so need
* to free the loader_ctx->frame_csp if fails */
free_label_patch_list(loader_ctx->frame_csp);
goto fail;
}

apply_label_patch(loader_ctx, 0, PATCH_END);
free_label_patch_list(loader_ctx->frame_csp);
Expand Down
18 changes: 9 additions & 9 deletions core/iwasm/interpreter/wasm_mini_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -5592,13 +5592,6 @@ reserve_block_ret(WASMLoaderContext *loader_ctx, uint8 opcode,

#endif /* WASM_ENABLE_FAST_INTERP */

#define RESERVE_BLOCK_RET() \
do { \
if (!reserve_block_ret(loader_ctx, opcode, disable_emit, error_buf, \
error_buf_size)) \
goto fail; \
} while (0)

#define PUSH_TYPE(type) \
do { \
if (!(wasm_loader_push_frame_ref(loader_ctx, type, error_buf, \
Expand Down Expand Up @@ -6366,7 +6359,10 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
#if WASM_ENABLE_FAST_INTERP != 0
/* if the result of if branch is in local or const area, add a
* copy op */
RESERVE_BLOCK_RET();
if (!reserve_block_ret(loader_ctx, opcode, disable_emit,
error_buf, error_buf_size)) {
goto fail;
}

emit_empty_label_addr_and_frame_ip(PATCH_END);
apply_label_patch(loader_ctx, 1, PATCH_ELSE);
Expand Down Expand Up @@ -6426,7 +6422,11 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
#if WASM_ENABLE_FAST_INTERP != 0
skip_label();
/* copy the result to the block return address */
RESERVE_BLOCK_RET();
if (!reserve_block_ret(loader_ctx, opcode, disable_emit,
error_buf, error_buf_size)) {
free_label_patch_list(loader_ctx->frame_csp);
goto fail;
}

apply_label_patch(loader_ctx, 0, PATCH_END);
free_label_patch_list(loader_ctx->frame_csp);
Expand Down
2 changes: 1 addition & 1 deletion core/iwasm/interpreter/wasm_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@ globals_instantiate(WASMModule *module, WASMModuleInstance *module_inst,
/* The linked global instance has been initialized, we
just need to copy the value. */
bh_memcpy_s(&(global->initial_value), sizeof(WASMValue),
&(global_import->import_global_linked->init_expr),
&(global_import->import_global_linked->init_expr.u),
sizeof(WASMValue));
}
else
Expand Down
2 changes: 2 additions & 0 deletions core/shared/platform/windows/win_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
#define NANOSECONDS_PER_SECOND 1000000000ULL
#define NANOSECONDS_PER_TICK 100

#if WINAPI_PARTITION_DESKTOP
extern NTSTATUS
NtQueryTimerResolution(PULONG MinimumResolution, PULONG MaximumResolution,
PULONG CurrentResolution);
#endif

static __wasi_errno_t
calculate_monotonic_clock_frequency(uint64 *out_frequency)
Expand Down
Loading