Skip to content

Commit bf4c39c

Browse files
author
Daniel Kroening
authored
Merge pull request diffblue#1966 from JohnDumbell/JohnDumbell/Update-Assertion-Validation
Increase AssertionError arguments allowed from 2 to 3
2 parents 74a37c6 + 97d556e commit bf4c39c

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
public class AssertionIssue {
2+
3+
public static void throwAssertion() {
4+
throw new AssertionError("Something went terribly wrong.", new ThrowableAssertion());
5+
}
6+
7+
public static class ThrowableAssertion extends Throwable {
8+
@Override
9+
public String getMessage() {
10+
return "How did we get here?";
11+
}
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
AssertionIssue.class
3+
--function AssertionIssue.throwAssertion
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED$
7+
--
8+
^warning: ignoring

src/goto-programs/builtin_functions.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -969,11 +969,11 @@ void goto_convertt::do_function_call_symbol(
969969

970970
copy(function_call, FUNCTION_CALL, dest);
971971

972-
if(arguments.size()!=1 && arguments.size()!=2)
972+
if(arguments.size() != 1 && arguments.size() != 2 && arguments.size() != 3)
973973
{
974974
error().source_location=function.find_source_location();
975975
error() << "`" << identifier
976-
<< "' expected to have one or two arguments" << eom;
976+
<< "' expected to have one, two or three arguments" << eom;
977977
throw 0;
978978
}
979979

0 commit comments

Comments
 (0)