Fix crash, if cling is started with the arguments -xcuda -fsyntax-only

The crash occurs due to a missing guard that prevents `libcudart.so` from being
loaded. Loading a library requires an executor which is not available in
syntax-only mode.
This commit is contained in:
Simeon Ehrig 2022-05-28 15:11:20 +00:00 committed by jenkins
parent 5754b5ada3
commit 521bf307eb

View File

@ -280,7 +280,7 @@ namespace cling {
setupCallbacks(*this, parentInterp);
}
if(m_Opts.CompilerOpts.CUDAHost){
if (m_Opts.CompilerOpts.CUDAHost && !isInSyntaxOnlyMode()) {
if (getDynamicLibraryManager()->loadLibrary("libcudart.so", true) ==
cling::DynamicLibraryManager::LoadLibResult::kLoadLibNotFound){
llvm::errs() << "Error: libcudart.so not found!\n" <<