mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
Add js_dbuf_realloc to avoid ubsan error
This commit is contained in:
parent
b9de2b0bf8
commit
07fa1cbc4a
1 changed files with 7 additions and 1 deletions
|
@ -1388,6 +1388,12 @@ void *js_realloc_rt(JSRuntime *rt, void *ptr, size_t size)
|
|||
return rt->mf.js_realloc(&rt->malloc_state, ptr, size);
|
||||
}
|
||||
|
||||
static void *js_dbuf_realloc(void *opaque, void *ptr, size_t size)
|
||||
{
|
||||
JSRuntime *rt = opaque;
|
||||
return js_realloc_rt(rt, ptr, size);
|
||||
}
|
||||
|
||||
size_t js_malloc_usable_size_rt(JSRuntime *rt, const void *ptr)
|
||||
{
|
||||
return rt->mf.js_malloc_usable_size(ptr);
|
||||
|
@ -1517,7 +1523,7 @@ static inline int js_resize_array(JSContext *ctx, void **parray, int elem_size,
|
|||
|
||||
static inline void js_dbuf_init(JSContext *ctx, DynBuf *s)
|
||||
{
|
||||
dbuf_init2(s, ctx->rt, (DynBufReallocFunc *)js_realloc_rt);
|
||||
dbuf_init2(s, ctx->rt, js_dbuf_realloc);
|
||||
}
|
||||
|
||||
static inline int is_digit(int c) {
|
||||
|
|
Loading…
Reference in a new issue