diff --git a/src/processor.cpp b/src/processor.cpp index c8412bf037c26..a3502eb9dac99 100644 --- a/src/processor.cpp +++ b/src/processor.cpp @@ -630,11 +630,12 @@ static inline jl_image_t parse_sysimg(void *hdl, F &&callback) jl_dlsym(hdl, "jl_image_pointers", (void**)&pointers, 1); const void *ids = pointers->target_data; - jl_value_t* rejection_reason = C_NULL; + jl_value_t* rejection_reason = nullptr; JL_GC_PUSH1(&rejection_reason); uint32_t target_idx = callback(ids, &rejection_reason); - if target_idx == -1; - jl_error(rejection_reason); + if (target_idx == (uint32_t)-1) { + jl_throw(jl_new_struct(jl_errorexception_type, rejection_reason)); + } JL_GC_POP(); if (pointers->header->version != 1) { @@ -984,7 +985,7 @@ extern "C" JL_DLLEXPORT jl_value_t* jl_reflect_clone_targets() { data.insert(data.end(), specdata.begin(), specdata.end()); } - arr = (jl_value_t*)jl_alloc_array_1d(jl_array_uint8_type, data.size()); + jl_value_t *arr = (jl_value_t*)jl_alloc_array_1d(jl_array_uint8_type, data.size()); uint8_t *out = (uint8_t*)jl_array_data(arr); memcpy(out, data.data(), data.size()); return arr; diff --git a/src/processor_arm.cpp b/src/processor_arm.cpp index 972d4b171b057..22427107bc34e 100644 --- a/src/processor_arm.cpp +++ b/src/processor_arm.cpp @@ -1825,7 +1825,7 @@ JL_DLLEXPORT jl_value_t* jl_check_pkgimage_clones(char *data) JL_GC_PUSH1(&rejection_reason); uint32_t match_idx = pkgimg_init_cb(data, &rejection_reason); JL_GC_POP(); - if (match_idx == -1) + if (match_idx == (uint32_t)-1) return rejection_reason; return jl_nothing; } diff --git a/src/processor_fallback.cpp b/src/processor_fallback.cpp index a46851eac2983..40137efbfaa5b 100644 --- a/src/processor_fallback.cpp +++ b/src/processor_fallback.cpp @@ -176,7 +176,7 @@ JL_DLLEXPORT jl_value_t* jl_check_pkgimage_clones(char *data) JL_GC_PUSH1(&rejection_reason); uint32_t match_idx = pkgimg_init_cb(data, &rejection_reason); JL_GC_POP(); - if (match_idx == -1) + if (match_idx == (uint32_t)-1) return rejection_reason; return jl_nothing; } diff --git a/src/processor_x86.cpp b/src/processor_x86.cpp index de1b383ad196f..d690d7cd60dd2 100644 --- a/src/processor_x86.cpp +++ b/src/processor_x86.cpp @@ -869,7 +869,7 @@ static uint32_t sysimg_init_cb(const void *id, jl_value_t** rejection_reason) "https://docs.julialang.org/en/v1/devdocs/sysimg/ for more."); } auto match = match_sysimg_targets(sysimg, target, max_vector_size, rejection_reason); - if match.best_idx == -1 + if (match.best_idx == (uint32_t)-1) return match.best_idx; // Now we've decided on which sysimg version to use. // Make sure the JIT target is compatible with it and save the JIT target. @@ -1040,7 +1040,7 @@ JL_DLLEXPORT jl_value_t* jl_check_pkgimage_clones(char *data) JL_GC_PUSH1(&rejection_reason); uint32_t match_idx = pkgimg_init_cb(data, &rejection_reason); JL_GC_POP(); - if (match_idx == -1) + if (match_idx == (uint32_t)-1) return rejection_reason; return jl_nothing; }