File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1594,6 +1594,9 @@ struct JuliaOJIT::DLSymOptimizer {
15941594 auto libname = cast<ConstantDataArray>(GV->getInitializer ())->getAsCString ();
15951595 addr = lookup (libname.data (), fname.data ());
15961596 } else {
1597+ // Can happen if we fail the compile time dlfind i.e when we try a symbol that doesn't exist in libc
1598+ if (dyn_cast<ConstantPointerNull>(libarg))
1599+ continue ;
15971600 assert (cast<ConstantExpr>(libarg)->getOpcode () == Instruction::IntToPtr && " libarg should be either a global variable or a integer index!" );
15981601 libarg = cast<ConstantExpr>(libarg)->getOperand (0 );
15991602 auto libidx = cast<ConstantInt>(libarg)->getZExtValue ();
Original file line number Diff line number Diff line change @@ -1922,10 +1922,15 @@ function somefunction_not_found()
19221922 ccall ((:somefunction , libfrobozz), Cvoid, ())
19231923end
19241924
1925+ function somefunction_not_found_libc ()
1926+ ccall (:test ,Int,())
1927+ end
1928+
19251929@testset " library not found" begin
19261930 if Sys. islinux ()
19271931 @test_throws " could not load symbol \" somefunction\" " somefunction_not_found ()
19281932 else
19291933 @test_throws " could not load library \"\" " somefunction_not_found ()
19301934 end
1935+ @test_throws " could not load symbol \" test\" " somefunction_not_found_libc ()
19311936end
You can’t perform that action at this time.
0 commit comments