Skip to content

Commit

Permalink
dln.c: dln_incompatible_library_p
Browse files Browse the repository at this point in the history
* dln.c (dln_incompatible_library_p): renamed as the error message
  with dln prefix, since it is not bound to xmalloc restrictively.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Jan 3, 2018
1 parent 21a2146 commit 44cf5ba
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions dln.c
Original file line number Diff line number Diff line change
Expand Up @@ -1244,17 +1244,15 @@ rb_w32_check_imported(HMODULE ext, HMODULE mine)
#endif

#ifdef USE_DLN_DLOPEN
static bool xmalloc_mismatch_p(void *handle);

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpedantic"
#elif defined(__GNUC__) && (__GNUC__ >= 5)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
#endif
bool
xmalloc_mismatch_p(void *handle)
static bool
dln_incompatible_library_p(void *handle)
{
void *ex = dlsym(handle, EXTERNAL_PREFIX"ruby_xmalloc");
return ex && ex != ruby_xmalloc;
Expand Down Expand Up @@ -1353,7 +1351,7 @@ dln_load(const char *file)
}
# if defined RUBY_EXPORT
{
if (xmalloc_mismatch_p(handle)) {
if (dln_incompatible_library_p(handle)) {

# if defined __APPLE__ && \
defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
Expand Down

0 comments on commit 44cf5ba

Please sign in to comment.