mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-08 20:56:13 +00:00
![]() When checking for integer overflow, you may often write tests like p + i < p. This works fine if p and i are unsigned integers, since any overflow in the addition will cause the value to simply "wrap around." However, using this pattern when p is a pointer is problematic because pointer overflow has undefined behavior according to the C and C++ standards. If the addition overflows and has an undefined result, the comparison will likewise be undefined; it may produce an unintended result, or may be deleted entirely by an optimizing compiler. |
||
---|---|---|
.. | ||
arch | ||
gc | ||
iwasm_common.cmake | ||
SConscript | ||
wasm_application.c | ||
wasm_blocking_op.c | ||
wasm_c_api_internal.h | ||
wasm_c_api.c | ||
wasm_exec_env.c | ||
wasm_exec_env.h | ||
wasm_loader_common.c | ||
wasm_loader_common.h | ||
wasm_memory.c | ||
wasm_memory.h | ||
wasm_native.c | ||
wasm_native.h | ||
wasm_runtime_common.c | ||
wasm_runtime_common.h | ||
wasm_shared_memory.c | ||
wasm_shared_memory.h | ||
wasm_suspend_flags.h |