File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1588,6 +1588,9 @@ struct JuliaOJIT::DLSymOptimizer {
1588
1588
assert (++++CI->use_begin () == CI->use_end ());
1589
1589
void *addr;
1590
1590
if (auto GV = dyn_cast<GlobalVariable>(libarg)) {
1591
+ // Can happen if the library is the empty string, just give up when that happens
1592
+ if (isa<ConstantAggregateZero>(GV->getInitializer ()))
1593
+ continue ;
1591
1594
auto libname = cast<ConstantDataArray>(GV->getInitializer ())->getAsCString ();
1592
1595
addr = lookup (libname.data (), fname.data ());
1593
1596
} else {
Original file line number Diff line number Diff line change @@ -1915,3 +1915,17 @@ end
1915
1915
ctest_total_const () = Val {ctest_total(1 + 2im)} ()
1916
1916
Core. Compiler. return_type (ctest_total_const, Tuple{}) == Val{2 + 0im }
1917
1917
end
1918
+
1919
+ const libfrobozz = " "
1920
+
1921
+ function somefunction_not_found ()
1922
+ ccall ((:somefunction , libfrobozz), Cvoid, ())
1923
+ end
1924
+
1925
+ @testset " library not found" begin
1926
+ if Sys. islinux ()
1927
+ @test_throws " could not load symbol \" somefunction\" " somefunction_not_found ()
1928
+ else
1929
+ @test_throws " could not load library \"\" " somefunction_not_found ()
1930
+ end
1931
+ end
You can’t perform that action at this time.
0 commit comments