summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
authorUrabe, Shyouhei <shyouhei@ruby-lang.org>2019-04-26 18:37:21 +0900
committerUrabe, Shyouhei <shyouhei@ruby-lang.org>2019-04-29 21:52:44 +0900
commit34e1079aef81d108890fb167d7df69960e994ff5 (patch)
tree8b9b28a53bc0072835b7f2a9350ef089ffea619b /mjit.c
parente7b18ca6d9b45b7e71694557b9fab8152c62c1ed (diff)
glibc says memcpy cannot take NULL
At least since 2004, glibc's <string.h> 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.
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c2
1 files changed, 1 insertions, 1 deletions
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