@@ -6672,14 +6672,19 @@ void Executor::runFunctionAsMain(Function *f, int argc, char **argv,
6672
6672
} else {
6673
6673
/* Find all calls to function specified in .prp file
6674
6674
* and combine them to single target forest */
6675
- KFunction *kEntryFunction = kmodule->functionMap .at (f);
6676
- ref<TargetForest> forest = new TargetForest (kEntryFunction );
6677
- auto kfunction = kmodule->functionNameMap .at (FunctionCallReproduce);
6678
- KBlock *kCallBlock = kfunction->entryKBlock ;
6679
- forest->add (ReproduceErrorTarget::create (
6680
- {ReachWithError::Reachable}, " " ,
6681
- ErrorLocation (kCallBlock ->getFirstInstruction ()), kCallBlock ));
6682
- prepTargets.emplace (kEntryFunction , forest);
6675
+ auto kfIt = kmodule->functionNameMap .find (FunctionCallReproduce);
6676
+ if (kfIt == kmodule->functionNameMap .end ()) {
6677
+ klee_warning (" %s was eliminated by LLVM passes, so it is unreachable" ,
6678
+ FunctionCallReproduce.c_str ());
6679
+ } else {
6680
+ auto kCallBlock = kfIt->second ->entryKBlock ;
6681
+ KFunction *kEntryFunction = kmodule->functionMap .at (f);
6682
+ ref<TargetForest> forest = new TargetForest (kEntryFunction );
6683
+ forest->add (ReproduceErrorTarget::create (
6684
+ {ReachWithError::Reachable}, " " ,
6685
+ ErrorLocation (kCallBlock ->getFirstInstruction ()), kCallBlock ));
6686
+ prepTargets.emplace (kEntryFunction , forest);
6687
+ }
6683
6688
}
6684
6689
6685
6690
if (prepTargets.empty ()) {
0 commit comments