Skip to content

Commit b804570

Browse files
author
Daniel Kroening
authored
Merge pull request diffblue#2048 from JohnDumbell/improvement/adding_null_object_id
[SEC-346] irep_ids: Adding in a NULL-object ID
2 parents 61f14d8 + 314ed53 commit b804570

19 files changed

+40
-43
lines changed

src/analyses/ai.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ bool ai_baset::do_function_call_rec(
506506
// We can't really do this here -- we rely on
507507
// these being removed by some previous analysis.
508508
}
509-
else if(function.id()=="NULL-object")
509+
else if(function.id() == ID_null_object)
510510
{
511511
// ignore, can't be a function
512512
}

src/analyses/flow_insensitive_analysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ bool flow_insensitive_analysis_baset::do_function_call_rec(
371371
}
372372
}
373373
}
374-
else if(function.id()=="NULL-object")
374+
else if(function.id() == ID_null_object)
375375
{
376376
// ignore, can't be a function
377377
}

src/analyses/goto_rw.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ void rw_range_sett::get_objects_index(
242242
const range_spect &range_start,
243243
const range_spect &size)
244244
{
245-
if(expr.array().id()=="NULL-object")
245+
if(expr.array().id() == ID_null_object)
246246
return;
247247

248248
range_spect sub_size=0;
@@ -413,10 +413,10 @@ void rw_range_sett::get_objects_typecast(
413413

414414
void rw_range_sett::get_objects_address_of(const exprt &object)
415415
{
416-
if(object.id()==ID_string_constant ||
417-
object.id()==ID_label ||
418-
object.id()==ID_array ||
419-
object.id()=="NULL-object")
416+
if(object.id() == ID_string_constant ||
417+
object.id() == ID_label ||
418+
object.id() == ID_array ||
419+
object.id() == ID_null_object)
420420
// constant, nothing to do
421421
return;
422422
else if(object.id()==ID_symbol)
@@ -558,8 +558,8 @@ void rw_range_sett::get_objects_rec(
558558
forall_operands(it, expr)
559559
get_objects_rec(mode, *it);
560560
}
561-
else if(expr.id()=="NULL-object" ||
562-
expr.id()==ID_string_constant)
561+
else if(expr.id() == ID_null_object ||
562+
expr.id() == ID_string_constant)
563563
{
564564
// dereferencing may yield some weird ones, ignore these
565565
}

src/analyses/invariant_set.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,10 +1036,10 @@ void invariant_sett::modifies(const exprt &lhs)
10361036
assert(lhs.operands().size()==2);
10371037
modifies(lhs.op0());
10381038
}
1039-
else if(lhs.id()=="NULL-object" ||
1040-
lhs.id()=="is_zero_string" ||
1041-
lhs.id()=="zero_string" ||
1042-
lhs.id()=="zero_string_length")
1039+
else if(lhs.id() == ID_null_object ||
1040+
lhs.id() == "is_zero_string" ||
1041+
lhs.id() == "zero_string" ||
1042+
lhs.id() == "zero_string_length")
10431043
{
10441044
// ignore
10451045
}

src/analyses/static_analysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ void static_analysis_baset::do_function_call_rec(
397397
}
398398
}
399399
}
400-
else if(function.id()=="NULL-object" ||
401-
function.id()==ID_integer_address)
400+
else if(function.id() == ID_null_object ||
401+
function.id() == ID_integer_address)
402402
{
403403
// ignore, can't be a function
404404
}

src/ansi-c/expr2c.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3556,10 +3556,7 @@ std::string expr2ct::convert_with_precedence(
35563556
else if(src.id()=="pointer_difference")
35573557
return convert_pointer_difference(src, precedence=16);
35583558

3559-
else if(src.id()=="NULL-object")
3560-
return "NULL-object";
3561-
3562-
else if(src.id()==ID_null_object)
3559+
else if(src.id() == ID_null_object)
35633560
return "NULL-object";
35643561

35653562
else if(src.id()==ID_integer_address ||

src/goto-programs/goto_convert_function_call.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void goto_convertt::do_function_call(
7171
do_function_call_symbol(
7272
new_lhs, to_symbol_expr(new_function), new_arguments, dest);
7373
}
74-
else if(new_function.id()=="NULL-object")
74+
else if(new_function.id() == ID_null_object)
7575
{
7676
}
7777
else if(new_function.id()==ID_dereference ||

src/goto-programs/interpreter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ void interpretert::build_memory_map()
862862
{
863863
// put in a dummy for NULL
864864
memory.resize(1);
865-
inverse_memory_map[0]="NULL-OBJECT";
865+
inverse_memory_map[0] = ID_null_object;
866866

867867
num_dynamic_objects=0;
868868
dynamic_types.clear();

src/goto-programs/string_abstraction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ exprt string_abstractiont::build_unknown(whatt what, bool write)
894894
typet type=build_type(what);
895895

896896
if(write)
897-
return exprt("NULL-object", type);
897+
return exprt(ID_null_object, type);
898898

899899
exprt result;
900900

@@ -916,7 +916,7 @@ exprt string_abstractiont::build_unknown(whatt what, bool write)
916916
exprt string_abstractiont::build_unknown(const typet &type, bool write)
917917
{
918918
if(write)
919-
return exprt("NULL-object", type);
919+
return exprt(ID_null_object, type);
920920

921921
// create an uninitialized dummy symbol
922922
// because of a lack of contextual information we can't build a nice name

src/goto-symex/symex_assign.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ void goto_symext::symex_assign_rec(
150150
else if(lhs.id()==ID_typecast)
151151
symex_assign_typecast(
152152
state, to_typecast_expr(lhs), full_lhs, rhs, guard, assignment_type);
153-
else if(lhs.id()==ID_string_constant ||
154-
lhs.id()=="NULL-object" ||
155-
lhs.id()=="zero_string" ||
156-
lhs.id()=="is_zero_string" ||
157-
lhs.id()=="zero_string_length")
153+
else if(lhs.id() == ID_string_constant ||
154+
lhs.id() == ID_null_object ||
155+
lhs.id() == "zero_string" ||
156+
lhs.id() == "is_zero_string" ||
157+
lhs.id() == "zero_string_length")
158158
{
159159
// ignore
160160
}
@@ -355,7 +355,7 @@ void goto_symext::symex_assign_struct_member(
355355
{
356356
assert(lhs_struct.operands().size()==1);
357357

358-
if(lhs_struct.op0().id()=="NULL-object")
358+
if(lhs_struct.op0().id() == ID_null_object)
359359
{
360360
// ignore, and give up
361361
return;

0 commit comments

Comments
 (0)