@@ -38,8 +38,16 @@ class string_builtin_functiont
38
38
virtual exprt
39
39
add_constraints (string_constraint_generatort &constraint_generator) const = 0 ;
40
40
41
- protected:
41
+ exprt return_code;
42
+
43
+ private:
42
44
string_builtin_functiont () = default ;
45
+
46
+ protected:
47
+ explicit string_builtin_functiont (const exprt &return_code)
48
+ : return_code(return_code)
49
+ {
50
+ }
43
51
};
44
52
45
53
// / String builtin_function transforming one string into another
@@ -49,14 +57,14 @@ class string_transformation_builtin_functiont : public string_builtin_functiont
49
57
array_string_exprt result;
50
58
array_string_exprt input;
51
59
std::vector<exprt> args;
52
- exprt return_code;
53
60
54
61
// / Constructor from arguments of a function application.
55
62
// / The arguments in `fun_args` should be in order:
56
63
// / an integer `result.length`, a character pointer `&result[0]`,
57
64
// / a string `arg1` of type refined_string_typet, and potentially some
58
65
// / arguments of primitive types.
59
66
string_transformation_builtin_functiont (
67
+ const exprt &return_code,
60
68
const std::vector<exprt> &fun_args,
61
69
array_poolt &array_pool);
62
70
@@ -88,9 +96,10 @@ class string_concat_char_builtin_functiont
88
96
// / an integer `result.length`, a character pointer `&result[0]`,
89
97
// / a string `arg1` of type refined_string_typet, and a character.
90
98
string_concat_char_builtin_functiont (
99
+ const exprt &return_code,
91
100
const std::vector<exprt> &fun_args,
92
101
array_poolt &array_pool)
93
- : string_transformation_builtin_functiont(fun_args, array_pool)
102
+ : string_transformation_builtin_functiont(return_code, fun_args, array_pool)
94
103
{
95
104
}
96
105
@@ -117,7 +126,6 @@ class string_insertion_builtin_functiont : public string_builtin_functiont
117
126
array_string_exprt input1;
118
127
array_string_exprt input2;
119
128
std::vector<exprt> args;
120
- exprt return_code;
121
129
122
130
// / Constructor from arguments of a function application.
123
131
// / The arguments in `fun_args` should be in order:
@@ -126,6 +134,7 @@ class string_insertion_builtin_functiont : public string_builtin_functiont
126
134
// / a string `arg2` of type refined_string_typet,
127
135
// / and potentially some arguments of primitive types.
128
136
string_insertion_builtin_functiont (
137
+ const exprt &return_code,
129
138
const std::vector<exprt> &fun_args,
130
139
array_poolt &array_pool);
131
140
@@ -162,7 +171,10 @@ class string_insertion_builtin_functiont : public string_builtin_functiont
162
171
};
163
172
164
173
protected:
165
- string_insertion_builtin_functiont () = default ;
174
+ explicit string_insertion_builtin_functiont (const exprt &return_code)
175
+ : string_builtin_functiont(return_code)
176
+ {
177
+ }
166
178
};
167
179
168
180
class string_concatenation_builtin_functiont final
@@ -176,6 +188,7 @@ class string_concatenation_builtin_functiont final
176
188
// / a string `arg2` of type refined_string_typet,
177
189
// / optionally followed by an integer `start` and an integer `end`.
178
190
string_concatenation_builtin_functiont (
191
+ const exprt &return_code,
179
192
const std::vector<exprt> &fun_args,
180
193
array_poolt &array_pool);
181
194
@@ -240,6 +253,7 @@ class string_builtin_function_with_no_evalt : public string_builtin_functiont
240
253
std::vector<exprt> args;
241
254
242
255
string_builtin_function_with_no_evalt (
256
+ const exprt &return_code,
243
257
const function_application_exprt &f,
244
258
array_poolt &array_pool);
245
259
0 commit comments