mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-08 20:56:13 +00:00
Fix aot compiler issue reported by Coverity (#2770)
Set `abi` to "gnu" for the bare-metal target when `abi` is NULL, or the below `bh_assert` and `bh_memcpy` may deference a NULL pointer. Error is reported when running wamrc compiled with `cmake .. -DCMAKE_BUILD_TYPE=Debug`: ``` core/iwasm/compilation/aot_llvm.c:2584:13: runtime error: null pointer passed as argument 1, which is declared to never be null ```
This commit is contained in:
parent
24aa1cb408
commit
9a32e0672c
|
@ -2572,6 +2572,8 @@ aot_create_comp_context(const AOTCompData *comp_data, aot_comp_option_t option)
|
||||||
}
|
}
|
||||||
else if (is_baremetal_target(arch, cpu, abi)) {
|
else if (is_baremetal_target(arch, cpu, abi)) {
|
||||||
vendor_sys = "-unknown-none-";
|
vendor_sys = "-unknown-none-";
|
||||||
|
if (!abi)
|
||||||
|
abi = "gnu";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
vendor_sys = "-pc-linux-";
|
vendor_sys = "-pc-linux-";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user