Skip to content

Commit c3ee142

Browse files
committed
Adding in new NULL_object ID to properly represent the string.
1 parent 7a38669 commit c3ee142

17 files changed

+26
-28
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: 3 additions & 3 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;
@@ -416,7 +416,7 @@ void rw_range_sett::get_objects_address_of(const exprt &object)
416416
if(object.id()==ID_string_constant ||
417417
object.id()==ID_label ||
418418
object.id()==ID_array ||
419-
object.id()=="NULL-object")
419+
object.id()==ID_NULL_object)
420420
// constant, nothing to do
421421
return;
422422
else if(object.id()==ID_symbol)
@@ -558,7 +558,7 @@ 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" ||
561+
else if(expr.id()==ID_NULL_object ||
562562
expr.id()==ID_string_constant)
563563
{
564564
// dereferencing may yield some weird ones, ignore these

src/analyses/invariant_set.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ 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" ||
1039+
else if(lhs.id()==ID_NULL_object ||
10401040
lhs.id()=="is_zero_string" ||
10411041
lhs.id()=="zero_string" ||
10421042
lhs.id()=="zero_string_length")

src/analyses/static_analysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ void static_analysis_baset::do_function_call_rec(
397397
}
398398
}
399399
}
400-
else if(function.id()=="NULL-object" ||
400+
else if(function.id()==ID_NULL_object ||
401401
function.id()==ID_integer_address)
402402
{
403403
// ignore, can't be a function

src/ansi-c/expr2c.cpp

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

3558-
else if(src.id()=="NULL-object")
3559-
return "NULL-object";
3560-
3561-
else if(src.id()==ID_null_object)
3558+
else if(src.id()==ID_null_object || src.id()==ID_NULL_object)
35623559
return "NULL-object";
35633560

35643561
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/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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void goto_symext::symex_assign_rec(
151151
symex_assign_typecast(
152152
state, to_typecast_expr(lhs), full_lhs, rhs, guard, assignment_type);
153153
else if(lhs.id()==ID_string_constant ||
154-
lhs.id()=="NULL-object" ||
154+
lhs.id()==ID_NULL_object ||
155155
lhs.id()=="zero_string" ||
156156
lhs.id()=="is_zero_string" ||
157157
lhs.id()=="zero_string_length")
@@ -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;

src/goto-symex/symex_other.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void goto_symext::havoc_rec(
3434
lhs=dest;
3535
else
3636
lhs=if_exprt(
37-
guard.as_expr(), dest, exprt("NULL-object", dest.type()));
37+
guard.as_expr(), dest, exprt(ID_NULL_object, dest.type()));
3838

3939
code_assignt assignment;
4040
assignment.lhs()=lhs;

0 commit comments

Comments
 (0)