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 {
15881588 assert (++++CI->use_begin () == CI->use_end ());
15891589 void *addr;
15901590 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 ;
15911594 auto libname = cast<ConstantDataArray>(GV->getInitializer ())->getAsCString ();
15921595 addr = lookup (libname.data (), fname.data ());
15931596 } else {
Original file line number Diff line number Diff line change @@ -1915,3 +1915,17 @@ end
19151915 ctest_total_const () = Val {ctest_total(1 + 2im)} ()
19161916 Core. Compiler. return_type (ctest_total_const, Tuple{}) == Val{2 + 0im }
19171917end
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