Branch: Tag:


2019-11-11 13:08:24 by Arne Goedeke <>

Compiler: do not make function names static strings

It is not safe to create static strings for constant C strings when
used from shared modules. When modules are unloaded the shared string
may then point into unmapped memory which will lead so segmentation

This is a partial revert of commit

1024:    INT_TYPE *linep);   struct supporter_marker;   void count_memory_in_supporter_markers(size_t *num, size_t *size); - PMOD_EXPORT int low_quick_add_function(struct pike_string *name_tmp, + PMOD_EXPORT int quick_add_function(const char *name, int name_length,    void (*cfun)(INT32),    const char *type,    int type_length,
1096:    return low_find_lfun(p, lfun);   }    - #define quick_add_function(NAME, NLEN, FUNC, TYPE, TLEN, FLAGS, OPT) \ -  low_quick_add_function(STATIC_IS_CONSTANT(NAME) \ -  ? make_shared_static_string(NAME, NLEN, eightbit) \ -  : make_shared_binary_string(NAME, NLEN), \ -  FUNC, TYPE, TLEN, FLAGS, OPT) +     -  +    #ifndef PIKE_USE_MACHINE_CODE   #define make_program_executable(X)   #endif