Commit 8b98ade3 authored by Markus Armbruster's avatar Markus Armbruster Committed by Michael Tokarev
Browse files

translate-all: Use g_try_malloc() for dynamic translator buffer



The USE_MMAP code can fail, and the caller handles the failure
already.  Let the !USE_MMAP code fail as well, for consistency.

Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Reviewed-by: default avatarGonglei <arei.gonglei@huawei.com>
Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
parent 4b3be730
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -631,7 +631,7 @@ static inline void *alloc_code_gen_buffer(void)
#else
static inline void *alloc_code_gen_buffer(void)
{
    void *buf = g_malloc(tcg_ctx.code_gen_buffer_size);
    void *buf = g_try_malloc(tcg_ctx.code_gen_buffer_size);

    if (buf == NULL) {
        return NULL;