@@ -32,7 +32,6 @@ instrumentation_props data structure.
32
32
bool is_primitive_type (const typet &type)
33
33
{
34
34
return type==java_boolean_type () ||
35
- type==java_boolean_type () ||
36
35
type==java_byte_type () ||
37
36
type==java_char_type () ||
38
37
type==java_short_type () ||
@@ -42,12 +41,12 @@ bool is_primitive_type(const typet &type)
42
41
type==java_double_type ();
43
42
}
44
43
45
- std::string parse_type_name (const typet &type, const namespacet &ns)
44
+ std::string unwrap_type_name (const typet &type, const namespacet &ns)
46
45
{
47
46
if (type.id ()==ID_pointer)
48
- return parse_type_name (to_pointer_type (type).subtype (), ns);
47
+ return unwrap_type_name (to_pointer_type (type).subtype (), ns);
49
48
if (type.id ()==ID_array)
50
- return parse_type_name (to_array_type (type).subtype (), ns);
49
+ return unwrap_type_name (to_array_type (type).subtype (), ns);
51
50
if (type.id ()==ID_symbol)
52
51
return as_string (to_symbol_type (type).get_identifier ());
53
52
const std::string result=type2java (type, ns);
@@ -175,6 +174,11 @@ Function: build_map_from_typenames_to_tokennames
175
174
Outputs:
176
175
177
176
Purpose:
177
+ The function fills in the member map "datatypes" so that for each
178
+ data type (identified by its type name, see "unwrap_type_name") to be
179
+ instrumented by a shadow variable there is computed an instance of
180
+ "taint_instrumentation_propst::datatype_infot" type holding details
181
+ about the instrumentation of the shadow variable into that type.
178
182
179
183
\*******************************************************************/
180
184
void taint_instrumentation_propst::build_map_from_typenames_to_tokennames (
@@ -192,7 +196,6 @@ void taint_instrumentation_propst::build_map_from_typenames_to_tokennames(
192
196
const std::string callee_ident = as_string (callee_id);
193
197
const code_typet &fn_type =
194
198
program.get_functions ().function_map .at (callee_id).type ;
195
- (void )fn_type;
196
199
197
200
std::set<argidx_and_tokennamet> to_process;
198
201
for (const auto &elem : loc.get_assumption ())
@@ -204,16 +207,18 @@ void taint_instrumentation_propst::build_map_from_typenames_to_tokennames(
204
207
205
208
for (const auto & arg_token : to_process)
206
209
{
207
- assert (arg_token.get_argidx ()!=
208
- taint_tokens_propagation_grapht::get_void_loc ());
210
+ assert (
211
+ arg_token.get_argidx ()!=
212
+ taint_tokens_propagation_grapht::get_void_loc ());
209
213
std::string datatype;
210
214
typet type;
211
215
if (arg_token.get_argidx ()==-1 ) // Return value?
212
216
type=get_return_type_from_function_name (
213
- callee_ident, program.get_symbol_table ());
217
+ callee_ident,
218
+ program.get_symbol_table ());
214
219
else
215
220
type=fn_type.parameters ().at (arg_token.get_argidx ()).type ();
216
- datatype=parse_type_name (type, program.get_namespace ());
221
+ datatype=unwrap_type_name (type, program.get_namespace ());
217
222
auto it=datatypes.find (datatype);
218
223
if (it!=datatypes.end ())
219
224
{
0 commit comments