mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-06-18 02:59:21 +00:00
Fix failed in loading wasm byte-code if return NULL while size == 0 in os_malloc (#500)
This commit is contained in:
parent
240ca2ed46
commit
6847e15f64
|
@ -28,10 +28,6 @@ void *os_malloc(unsigned size)
|
||||||
void *buf_fixed;
|
void *buf_fixed;
|
||||||
rt_ubase_t *addr_field;
|
rt_ubase_t *addr_field;
|
||||||
|
|
||||||
if (size == 0)
|
|
||||||
{
|
|
||||||
return RT_NULL;
|
|
||||||
}
|
|
||||||
buf_origin = rt_malloc(size + 8 + sizeof(rt_ubase_t));
|
buf_origin = rt_malloc(size + 8 + sizeof(rt_ubase_t));
|
||||||
buf_fixed = buf_origin + sizeof(void*);
|
buf_fixed = buf_origin + sizeof(void*);
|
||||||
if ((rt_ubase_t)buf_fixed & 0x7)
|
if ((rt_ubase_t)buf_fixed & 0x7)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user