From 34e1079aef81d108890fb167d7df69960e994ff5 Mon Sep 17 00:00:00 2001 From: "Urabe, Shyouhei" Date: Fri, 26 Apr 2019 18:37:21 +0900 Subject: [PATCH] glibc says memcpy cannot take NULL At least since 2004, glibc's annotates memcpy as __attribute__((__nonnull__)). This basedir is passed to it. When LOAD_RELATIVE is not defined and MJIT_SEARCH_BUILD_DIR is not set, this variable is never updated. Should initialize with meaningful default value. --- mjit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mjit.c b/mjit.c index 4d0819153d..a4550e922c 100644 --- a/mjit.c +++ b/mjit.c @@ -469,7 +469,7 @@ init_header_filename(void) // Root path of the running ruby process. Equal to RbConfig::TOPDIR. VALUE basedir_val; #endif - const char *basedir = NULL; + const char *basedir = ""; size_t baselen = 0; char *p; #ifdef _WIN32