mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-07-11 15:03:33 +00:00
Compare commits
9 Commits
4cd2611c10
...
52196450a7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
52196450a7 | ||
![]() |
17be90d8f0 | ||
![]() |
9e92f5ebe1 | ||
![]() |
334b4f8cb5 | ||
![]() |
56f87b7ee9 | ||
![]() |
933e49df18 | ||
![]() |
d6fc18e197 | ||
![]() |
cd4712d939 | ||
![]() |
903a5c1f8c |
6
.github/workflows/codeql.yml
vendored
6
.github/workflows/codeql.yml
vendored
|
@ -53,7 +53,7 @@ jobs:
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v3.29.1
|
uses: github/codeql-action/init@v3.29.2
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ jobs:
|
||||||
- run: |
|
- run: |
|
||||||
./.github/scripts/codeql_buildscript.sh
|
./.github/scripts/codeql_buildscript.sh
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v3.29.1
|
uses: github/codeql-action/analyze@v3.29.2
|
||||||
with:
|
with:
|
||||||
category: "/language:${{matrix.language}}"
|
category: "/language:${{matrix.language}}"
|
||||||
upload: false
|
upload: false
|
||||||
|
@ -99,7 +99,7 @@ jobs:
|
||||||
output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
|
output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
|
||||||
|
|
||||||
- name: Upload CodeQL results to code scanning
|
- name: Upload CodeQL results to code scanning
|
||||||
uses: github/codeql-action/upload-sarif@v3.29.1
|
uses: github/codeql-action/upload-sarif@v3.29.2
|
||||||
with:
|
with:
|
||||||
sarif_file: ${{ steps.step1.outputs.sarif-output }}
|
sarif_file: ${{ steps.step1.outputs.sarif-output }}
|
||||||
category: "/language:${{matrix.language}}"
|
category: "/language:${{matrix.language}}"
|
||||||
|
|
2
.github/workflows/supply_chain.yml
vendored
2
.github/workflows/supply_chain.yml
vendored
|
@ -60,6 +60,6 @@ jobs:
|
||||||
|
|
||||||
# Upload the results to GitHub's code scanning dashboard.
|
# Upload the results to GitHub's code scanning dashboard.
|
||||||
- name: "Upload to code-scanning"
|
- name: "Upload to code-scanning"
|
||||||
uses: github/codeql-action/upload-sarif@4c57370d0304fbff638216539f81d9163f77712a
|
uses: github/codeql-action/upload-sarif@b69421388d5449cc5a5e1ca344d71926bda69e07
|
||||||
with:
|
with:
|
||||||
sarif_file: results.sarif
|
sarif_file: results.sarif
|
||||||
|
|
|
@ -48,6 +48,7 @@ WebAssembly Micro Runtime (WAMR) is a lightweight standalone WebAssembly (Wasm)
|
||||||
- [Reference Types](https://github.com/WebAssembly/reference-types), ref to [document](doc/ref_types.md) and [sample](samples/ref-types)
|
- [Reference Types](https://github.com/WebAssembly/reference-types), ref to [document](doc/ref_types.md) and [sample](samples/ref-types)
|
||||||
- [Bulk memory operations](https://github.com/WebAssembly/bulk-memory-operations), [Shared memory](https://github.com/WebAssembly/threads/blob/main/proposals/threads/Overview.md#shared-linear-memory), [Memory64](https://github.com/WebAssembly/memory64)
|
- [Bulk memory operations](https://github.com/WebAssembly/bulk-memory-operations), [Shared memory](https://github.com/WebAssembly/threads/blob/main/proposals/threads/Overview.md#shared-linear-memory), [Memory64](https://github.com/WebAssembly/memory64)
|
||||||
- [Tail-call](https://github.com/WebAssembly/tail-call), [Garbage Collection](https://github.com/WebAssembly/gc), [Exception Handling](https://github.com/WebAssembly/exception-handling)
|
- [Tail-call](https://github.com/WebAssembly/tail-call), [Garbage Collection](https://github.com/WebAssembly/gc), [Exception Handling](https://github.com/WebAssembly/exception-handling)
|
||||||
|
- [Extended Constant Expressions](https://github.com/WebAssembly/extended-const)
|
||||||
|
|
||||||
### Supported architectures and platforms
|
### Supported architectures and platforms
|
||||||
The WAMR VMcore supports the following architectures:
|
The WAMR VMcore supports the following architectures:
|
||||||
|
|
|
@ -4711,7 +4711,7 @@ aot_unload(AOTModule *module)
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32
|
uint32
|
||||||
aot_get_plt_table_size()
|
aot_get_plt_table_size(void)
|
||||||
{
|
{
|
||||||
return get_plt_table_size();
|
return get_plt_table_size();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
static char aot_error[128];
|
static char aot_error[128];
|
||||||
|
|
||||||
char *
|
char *
|
||||||
aot_get_last_error()
|
aot_get_last_error(void)
|
||||||
{
|
{
|
||||||
return aot_error[0] == '\0' ? "" : aot_error;
|
return aot_error[0] == '\0' ? "" : aot_error;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1905,7 +1905,7 @@ aot_emit_init_expr(uint8 *buf, uint8 *buf_end, uint32 *p_offset,
|
||||||
{
|
{
|
||||||
WASMArrayType *array_type = NULL;
|
WASMArrayType *array_type = NULL;
|
||||||
|
|
||||||
bh_assert(expr->u.array_new_default.type_index
|
bh_assert(expr->u.unary.v.array_new_default.type_index
|
||||||
< module->type_count);
|
< module->type_count);
|
||||||
array_type =
|
array_type =
|
||||||
(WASMArrayType *)
|
(WASMArrayType *)
|
||||||
|
|
|
@ -98,10 +98,10 @@ void
|
||||||
aot_destroy_aot_file(uint8_t *aot_file);
|
aot_destroy_aot_file(uint8_t *aot_file);
|
||||||
|
|
||||||
char *
|
char *
|
||||||
aot_get_last_error();
|
aot_get_last_error(void);
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
aot_get_plt_table_size();
|
aot_get_plt_table_size(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -999,12 +999,10 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
|
||||||
/* ref.null */
|
/* ref.null */
|
||||||
case INIT_EXPR_TYPE_REFNULL_CONST:
|
case INIT_EXPR_TYPE_REFNULL_CONST:
|
||||||
{
|
{
|
||||||
uint8 type1;
|
|
||||||
|
|
||||||
#if WASM_ENABLE_GC == 0
|
#if WASM_ENABLE_GC == 0
|
||||||
|
uint8 type1;
|
||||||
CHECK_BUF(p, p_end, 1);
|
CHECK_BUF(p, p_end, 1);
|
||||||
type1 = read_uint8(p);
|
type1 = read_uint8(p);
|
||||||
|
|
||||||
cur_value.ref_index = NULL_REF;
|
cur_value.ref_index = NULL_REF;
|
||||||
if (!push_const_expr_stack(&const_expr_ctx, flag, type1,
|
if (!push_const_expr_stack(&const_expr_ctx, flag, type1,
|
||||||
&cur_value,
|
&cur_value,
|
||||||
|
@ -1014,23 +1012,34 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
|
||||||
error_buf, error_buf_size))
|
error_buf, error_buf_size))
|
||||||
goto fail;
|
goto fail;
|
||||||
#else
|
#else
|
||||||
|
/*
|
||||||
|
* According to the current GC SPEC rules, the heap_type must be
|
||||||
|
* validated when ref.null is used. It can be an absheaptype,
|
||||||
|
* or the type C.types[type_idx] must be defined in the context.
|
||||||
|
*/
|
||||||
int32 heap_type;
|
int32 heap_type;
|
||||||
read_leb_int32(p, p_end, heap_type);
|
read_leb_int32(p, p_end, heap_type);
|
||||||
type1 = (uint8)((int32)0x80 + heap_type);
|
|
||||||
|
|
||||||
cur_value.gc_obj = NULL_REF;
|
cur_value.gc_obj = NULL_REF;
|
||||||
|
|
||||||
if (!is_byte_a_type(type1)
|
/*
|
||||||
|| !wasm_is_valid_heap_type(heap_type)
|
* The current check of heap_type can deterministically infer
|
||||||
|| wasm_is_type_multi_byte_type(type1)) {
|
* the result of the previous condition
|
||||||
p--;
|
* `(!is_byte_a_type(type1) ||
|
||||||
read_leb_uint32(p, p_end, type_idx);
|
* wasm_is_type_multi_byte_type(type1))`. Therefore, the
|
||||||
if (!check_type_index(module, module->type_count, type_idx,
|
* original condition is redundant and has been removed.
|
||||||
error_buf, error_buf_size))
|
*
|
||||||
goto fail;
|
* This logic is consistent with the implementation of the
|
||||||
|
* `WASM_OP_REF_NULL` case in the `wasm_loader_prepare_bytecode`
|
||||||
|
* function.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (heap_type >= 0) {
|
||||||
|
if (!check_type_index(module, module->type_count, heap_type,
|
||||||
|
error_buf, error_buf_size)) {
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
wasm_set_refheaptype_typeidx(&cur_ref_type.ref_ht_typeidx,
|
wasm_set_refheaptype_typeidx(&cur_ref_type.ref_ht_typeidx,
|
||||||
true, type_idx);
|
true, heap_type);
|
||||||
if (!push_const_expr_stack(&const_expr_ctx, flag,
|
if (!push_const_expr_stack(&const_expr_ctx, flag,
|
||||||
cur_ref_type.ref_type,
|
cur_ref_type.ref_type,
|
||||||
&cur_ref_type, 0, &cur_value,
|
&cur_ref_type, 0, &cur_value,
|
||||||
|
@ -1041,8 +1050,16 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!push_const_expr_stack(&const_expr_ctx, flag, type1,
|
if (!wasm_is_valid_heap_type(heap_type)) {
|
||||||
NULL, 0, &cur_value,
|
set_error_buf_v(error_buf, error_buf_size,
|
||||||
|
"unknown type %d", heap_type);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
cur_ref_type.ref_ht_common.ref_type =
|
||||||
|
(uint8)((int32)0x80 + heap_type);
|
||||||
|
if (!push_const_expr_stack(&const_expr_ctx, flag,
|
||||||
|
cur_ref_type.ref_type, NULL, 0,
|
||||||
|
&cur_value,
|
||||||
#if WASM_ENABLE_EXTENDED_CONST_EXPR != 0
|
#if WASM_ENABLE_EXTENDED_CONST_EXPR != 0
|
||||||
NULL,
|
NULL,
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -17,6 +17,10 @@ extern char const *LLAMA_COMMIT;
|
||||||
extern char const *LLAMA_COMPILER;
|
extern char const *LLAMA_COMPILER;
|
||||||
extern char const *LLAMA_BUILD_TARGET;
|
extern char const *LLAMA_BUILD_TARGET;
|
||||||
|
|
||||||
|
#if WASM_ENABLE_WASI_EPHEMERAL_NN == 0
|
||||||
|
#error This backend doesn't support legacy "wasi_nn" abi. Please enable WASM_ENABLE_WASI_EPHEMERAL_NN.
|
||||||
|
#endif
|
||||||
|
|
||||||
// compatible with WasmEdge
|
// compatible with WasmEdge
|
||||||
// https://github.com/second-state/WasmEdge-WASINN-examples/blob/master/wasmedge-ggml/README.md#parameters
|
// https://github.com/second-state/WasmEdge-WASINN-examples/blob/master/wasmedge-ggml/README.md#parameters
|
||||||
// https://github.com/WasmEdge/WasmEdge/blob/master/plugins/wasi_nn/ggml.cpp
|
// https://github.com/WasmEdge/WasmEdge/blob/master/plugins/wasi_nn/ggml.cpp
|
||||||
|
|
|
@ -9,6 +9,10 @@
|
||||||
|
|
||||||
#include "openvino/c/openvino.h"
|
#include "openvino/c/openvino.h"
|
||||||
|
|
||||||
|
#if WASM_ENABLE_WASI_EPHEMERAL_NN == 0
|
||||||
|
#error This backend doesn't support legacy "wasi_nn" abi. Please enable WASM_ENABLE_WASI_EPHEMERAL_NN.
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* refer to
|
* refer to
|
||||||
* https://docs.openvino.ai/2024/openvino-workflow/running-inference/integrate-openvino-with-your-application.html
|
* https://docs.openvino.ai/2024/openvino-workflow/running-inference/integrate-openvino-with-your-application.html
|
||||||
|
|
|
@ -406,12 +406,11 @@ os_socket_addr_resolve(const char *host, const char *service,
|
||||||
|
|
||||||
res = result;
|
res = result;
|
||||||
while (res) {
|
while (res) {
|
||||||
|
if (!is_addrinfo_supported(res)) {
|
||||||
|
res = res->ai_next;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (addr_info_size > pos) {
|
if (addr_info_size > pos) {
|
||||||
if (!is_addrinfo_supported(res)) {
|
|
||||||
res = res->ai_next;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret =
|
ret =
|
||||||
sockaddr_to_bh_sockaddr(res->ai_addr, &addr_info[pos].sockaddr);
|
sockaddr_to_bh_sockaddr(res->ai_addr, &addr_info[pos].sockaddr);
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@ LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
|
||||||
option.enable_simd = true;
|
option.enable_simd = true;
|
||||||
option.enable_ref_types = true;
|
option.enable_ref_types = true;
|
||||||
option.enable_gc = true;
|
option.enable_gc = true;
|
||||||
|
option.aux_stack_frame_type = AOT_STACK_FRAME_TYPE_STANDARD;
|
||||||
|
|
||||||
comp_data =
|
comp_data =
|
||||||
aot_create_comp_data(module, option.target_arch, option.enable_gc);
|
aot_create_comp_data(module, option.target_arch, option.enable_gc);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user