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.
This commit is contained in:
Urabe, Shyouhei 2019-04-26 18:37:21 +09:00
Родитель e7b18ca6d9
Коммит 34e1079aef
1 изменённых файлов: 1 добавлений и 1 удалений

2
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