From 915644f3b3e54c30c4bebb48efe95ab35d682bf3 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Sun, 12 Jan 2014 17:20:35 -0800 Subject: [PATCH] fix(util/debug): avoid infinite loop when Ctrl-D is pressed after an assertion violation Signed-off-by: Leonardo de Moura --- src/util/debug.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/debug.cpp b/src/util/debug.cpp index 958736dc47..f9428ab386 100644 --- a/src/util/debug.cpp +++ b/src/util/debug.cpp @@ -60,6 +60,8 @@ void invoke_debugger() { g_has_violations = true; int * x = 0; for (;;) { + if (std::cin.eof()) + exit(1); #ifdef _WINDOWS std::cerr << "(C)ontinue, (A)bort, (S)top\n"; #else @@ -73,6 +75,7 @@ void invoke_debugger() { return; case 'A': case 'a': + case EOF: exit(1); case 'S': case 's':