fix(util/debug): avoid infinite loop when Ctrl-D is pressed after an assertion violation
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
5d9a95addd
commit
915644f3b3
1 changed files with 3 additions and 0 deletions
|
@ -60,6 +60,8 @@ void invoke_debugger() {
|
||||||
g_has_violations = true;
|
g_has_violations = true;
|
||||||
int * x = 0;
|
int * x = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
if (std::cin.eof())
|
||||||
|
exit(1);
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
std::cerr << "(C)ontinue, (A)bort, (S)top\n";
|
std::cerr << "(C)ontinue, (A)bort, (S)top\n";
|
||||||
#else
|
#else
|
||||||
|
@ -73,6 +75,7 @@ void invoke_debugger() {
|
||||||
return;
|
return;
|
||||||
case 'A':
|
case 'A':
|
||||||
case 'a':
|
case 'a':
|
||||||
|
case EOF:
|
||||||
exit(1);
|
exit(1);
|
||||||
case 'S':
|
case 'S':
|
||||||
case 's':
|
case 's':
|
||||||
|
|
Loading…
Reference in a new issue