File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -752,10 +752,17 @@ Interpreter::getSymbolAddressFromLinkerName(llvm::StringRef Name) const {
752752
753753llvm::Error Interpreter::Undo (unsigned N) {
754754
755- if (N > getEffectivePTUSize ())
755+ if (getEffectivePTUSize () == 0 ) {
756756 return llvm::make_error<llvm::StringError>(" Operation failed. "
757757 " No input left to undo" ,
758758 std::error_code ());
759+ } else if (N > getEffectivePTUSize ()) {
760+ return llvm::make_error<llvm::StringError>(
761+ llvm::formatv (" Wanted to undo {0} inputs, only have {1}." ,
762+ N, getEffectivePTUSize ()),
763+ std::error_code ());
764+ }
765+
759766 for (unsigned I = 0 ; I < N; I++) {
760767 if (IncrExecutor) {
761768 if (llvm::Error Err = IncrExecutor->removeModule (PTUs.back ()))
You can’t perform that action at this time.
0 commit comments