mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-14 21:51:27 +00:00
Remove PRI macro control in wasm_application.c (#905)
And fix read_leb byte count check issue in aot_compiler.c
This commit is contained in:
parent
4cc4625a2b
commit
af251e45ca
|
@ -586,16 +586,7 @@ wasm_application_execute_func(WASMModuleInstanceCommon *module_inst,
|
||||||
u.parts[0] = argv1[k];
|
u.parts[0] = argv1[k];
|
||||||
u.parts[1] = argv1[k + 1];
|
u.parts[1] = argv1[k + 1];
|
||||||
k += 2;
|
k += 2;
|
||||||
#ifdef PRIx64
|
|
||||||
os_printf("0x%" PRIx64 ":i64", u.val);
|
os_printf("0x%" PRIx64 ":i64", u.val);
|
||||||
#else
|
|
||||||
char buf[16];
|
|
||||||
if (sizeof(long) == 4)
|
|
||||||
snprintf(buf, sizeof(buf), "%s", "0x%llx:i64");
|
|
||||||
else
|
|
||||||
snprintf(buf, sizeof(buf), "%s", "0x%lx:i64");
|
|
||||||
os_printf(buf, u.val);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VALUE_TYPE_F32:
|
case VALUE_TYPE_F32:
|
||||||
|
@ -645,17 +636,8 @@ wasm_application_execute_func(WASMModuleInstanceCommon *module_inst,
|
||||||
case VALUE_TYPE_V128:
|
case VALUE_TYPE_V128:
|
||||||
{
|
{
|
||||||
uint64 *v = (uint64 *)(argv1 + k);
|
uint64 *v = (uint64 *)(argv1 + k);
|
||||||
#if defined(PRIx64)
|
|
||||||
os_printf("<0x%016" PRIx64 " 0x%016" PRIx64 ">:v128", *v,
|
os_printf("<0x%016" PRIx64 " 0x%016" PRIx64 ">:v128", *v,
|
||||||
*(v + 1));
|
*(v + 1));
|
||||||
#else
|
|
||||||
if (4 == sizeof(long)) {
|
|
||||||
os_printf("<0x%016llx 0x%016llx>:v128", *v, *(v + 1));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
os_printf("<0x%016lx 0x%016lx>:v128", *v, *(v + 1));
|
|
||||||
}
|
|
||||||
#endif /* PRIx64 */
|
|
||||||
k += 4;
|
k += 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,8 +64,9 @@ read_leb(const uint8 *buf, const uint8 *buf_end, uint32 *p_offset,
|
||||||
}
|
}
|
||||||
bcnt += 1;
|
bcnt += 1;
|
||||||
}
|
}
|
||||||
if (bcnt > (((maxbits + 8) >> 3) - (maxbits + 8))) {
|
if (bcnt > (maxbits + 6) / 7) {
|
||||||
aot_set_last_error("read leb failed: unsigned leb overflow.");
|
aot_set_last_error("read leb failed: "
|
||||||
|
"integer representation too long");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (sign && (shift < maxbits) && (byte & 0x40)) {
|
if (sign && (shift < maxbits) && (byte & 0x40)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user