Skip to content

Commit

Permalink
Fix error 'Expect<T> must be checked before access or destruction'
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcdonell committed Aug 9, 2023
1 parent 0b2a0ad commit e4b3cfa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion llvm-hs/src/LLVM/Internal/FFI/OrcJITC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ extern "C" {
// ExecutionSession

ExecutionSession *LLVM_Hs_createExecutionSession() {
return new ExecutionSession(std::move(*SelfExecutorProcessControl::Create()));
if (auto e = SelfExecutorProcessControl::Create()) {
return new ExecutionSession(std::move(*e));
} else {
llvm::errs() << e.takeError() << "\n";
// FIXME: Better error handling
exit(1);
}
}

void LLVM_Hs_disposeExecutionSession(ExecutionSession *es) {
Expand Down

0 comments on commit e4b3cfa

Please sign in to comment.