Skip to content

Commit

Permalink
fix off-by-one error in jl_pathname_for_handle on OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
ihnorton authored and JeffBezanson committed Apr 13, 2017
1 parent 653fb16 commit aaec5e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ JL_DLLEXPORT const char *jl_pathname_for_handle(void *handle)

#ifdef __APPLE__
// Iterate through all images currently in memory
for (int32_t i = _dyld_image_count(); i >= 0 ; i--) {
for (int32_t i = _dyld_image_count() - 1; i >= 0 ; i--) {
// dlopen() each image, check handle
const char *image_name = _dyld_get_image_name(i);
void *probe_lib = jl_load_dynamic_library(image_name, JL_RTLD_DEFAULT);
Expand Down

0 comments on commit aaec5e2

Please sign in to comment.