Skip to content

Commit 55b109d

Browse files
mmueslydanpoe
authored andcommitted
Update to work with diffblue#2713 for clean c code output
1 parent 89227eb commit 55b109d

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

regression/memory-analyzer/arrays/test.desc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ arrays.exe
44
analyzing symbol: test_struct
55
GENERATED CODE:
66
\{
7-
char _test_struct_childs0_options0_text_1\[7l\]="accept";
8-
char _test_struct_childs0_options1_text_2\[8l\]="unique0";
9-
char _test_struct_childs1_options1_text_3\[8l\]="unique1";
10-
char _test_struct_childs2_options1_text_4\[8l\]="unique2";
11-
char _test_struct_childs3_options1_text_5\[8l\]="unique3";
7+
char _test_struct_childs0_options0_text_1\[\]="accept";
8+
char _test_struct_childs0_options1_text_2\[\]="unique0";
9+
char _test_struct_childs1_options1_text_3\[\]="unique1";
10+
char _test_struct_childs2_options1_text_4\[\]="unique2";
11+
char _test_struct_childs3_options1_text_5\[\]="unique3";
1212
struct a_typet test_struct_0=\{ .config=\{ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 \}, .initalized=0,
1313
.values=\{ 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171 \}, .childs=\{ \{ .id=12, .options=\{ \{ .text=\(char \*\)&_test_struct_childs0_options0_text_1 \},
1414
\{ .text=\(char \*\)&_test_struct_childs0_options1_text_2 \} \} \},

regression/memory-analyzer/cycles/test.desc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ cycles.exe
44
analyzing symbol: buffer
55
GENERATED CODE:
66
\{
7-
char _buffer_start_data_1\[5l\]="snow";
8-
char __buffer_start_next_data_3\[4l\]="sun";
9-
char ___buffer_start_next_next_data_5\[5l\]="rain";
10-
char ____buffer_start_next_next_next_data_7\[14l\]="thunder storm";
7+
char _buffer_start_data_1\[\]="snow";
8+
char __buffer_start_next_data_3\[\]="sun";
9+
char ___buffer_start_next_next_data_5\[\]="rain";
10+
char ____buffer_start_next_next_next_data_7\[\]="thunder storm";
1111
struct cycle_buffer_entry ___buffer_start_next_next_next_6=\{ .data=\(char \*\)&____buffer_start_next_next_next_data_7, .next=\(\(struct cycle_buffer_entry \*\)NULL\) \};
1212
struct cycle_buffer_entry __buffer_start_next_next_4=\{ .data=\(char \*\)&___buffer_start_next_next_data_5, .next=&___buffer_start_next_next_next_6 \};
1313
struct cycle_buffer_entry _buffer_start_next_2=\{ .data=\(char \*\)&__buffer_start_next_data_3, .next=&__buffer_start_next_next_4 \};

regression/memory-analyzer/primitive_types/test.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ GENERATED CODE:
1212
e = 17;
1313
f = &e;
1414
f_1 = &e;
15-
char d_b_0\[6l\]="test2";
15+
char d_b_0\[\]="test2";
1616
d.a = 4;
1717
d.b = \(char \*\)&d_b_0;
1818
d.c = -32;
1919
struct mapping_things g_1=\{ .a=0, .b=\(\(char \*\)NULL\), .c=0 \};
2020
g = &g_1;
21-
char h_2\[5l\]="test";
21+
char h_2\[\]="test";
2222
h = \(char \*\)&h_2;
2323
}
2424
^EXIT=0

regression/memory-analyzer/void_pointer/test.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ analyzing symbol: blob
55
GENERATED CODE:
66
\{
77
a_void_pointer = NULL;
8-
char char_a_second_void_pointer_0\[12l\]="test_string";
8+
char char_a_second_void_pointer_0\[\]="test_string";
99
a_second_void_pointer = \(char \*\)&char_a_second_void_pointer_0;
10-
char char_a_third_void_pointer_1\[7ul\]=\{ -13, -13, 'H', -1, '\\\\', '\\\\', -1 \};
10+
char char_a_third_void_pointer_1\[\]=\{ -13, -13, 'H', -1, '\\\\', '\\\\', -1 \};
1111
a_third_void_pointer = \(char \*\)&char_a_third_void_pointer_1;
1212
blob.size = 7;
1313
blob.data = \(char \*\)&char_a_third_void_pointer_1;

src/memory-analyzer/analyze_symbol.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <algorithm>
88
#include <regex>
99

10-
#include <ansi-c/expr2c_class.h>
1110
#include <goto-programs/goto_model.h>
1211
#include <goto-programs/read_goto_binary.h>
1312
#include <util/arith_tools.h>
@@ -27,7 +26,11 @@ symbol_analyzert::symbol_analyzert(
2726
const symbol_tablet &st,
2827
gdb_apit &gdb,
2928
message_handlert &handler)
30-
: messaget(handler), gdb_api(gdb), ns(st), c_converter(ns), id_counter(0)
29+
: messaget(handler),
30+
gdb_api(gdb),
31+
ns(st),
32+
c_converter(ns, expr2c_configurationt::clean_configuration),
33+
id_counter(0)
3134
{
3235
}
3336

src/memory-analyzer/analyze_symbol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class symbol_analyzert : public messaget
2828
private:
2929
gdb_apit &gdb_api;
3030
const namespacet ns;
31-
expr2c_pretty_structt c_converter;
31+
expr2ct c_converter;
3232

3333
code_blockt generated_code;
3434
size_t id_counter;

0 commit comments

Comments
 (0)