Skip to content

Commit b02b2fd

Browse files
authored
Merge pull request diffblue#4265 from diffblue/trace-return-bug
function identifier in trace is wrong when function has no body
2 parents 8a49a13 + 458b0df commit b02b2fd

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
int function_to_call(int a)
22
{
3-
int local = 1;
4-
return a+local;
3+
int local = 1;
4+
return a + local;
55
}
66

7+
int function_without_body(int p);
78

89
int main()
910
{
10-
int a;
11-
unsigned int b;
12-
a = 0;
13-
a = -100;
14-
a = 2147483647;
15-
b = a*2;
16-
a = -2147483647;
17-
a = function_to_call(a);
18-
b = function_to_call(b);
19-
20-
__CPROVER_assert(0,"");
11+
int a;
12+
unsigned int b;
13+
a = 0;
14+
a = -100;
15+
a = 2147483647;
16+
b = a * 2;
17+
a = -2147483647;
18+
a = function_to_call(a);
19+
b = function_to_call(b);
20+
a = function_without_body(123);
2121

22+
__CPROVER_assert(0, "");
2223
}

regression/cbmc/trace_show_function_calls/test.desc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
CORE broken-smt-backend
1+
KNOWNBUG broken-smt-backend
22
main.c
33
--trace --trace-show-function-calls
44
^EXIT=10$
55
^SIGNAL=0$
66
Function call: function_to_call\(-2147483647\) \(depth 2\)
77
Function return from function_to_call \(depth 1\)
88
Function call: function_to_call\(-2\) \(depth 2\)
9+
Function call: function_without_body\(123\) \(depth 2\)
10+
Function return from function_without_body \(depth 1\)
911
^VERIFICATION FAILED$
1012
--
1113
^warning: ignoring

0 commit comments

Comments
 (0)