Skip to content

Commit f6f8e2f

Browse files
committed
Use plus_exprt constructor that does not take a type
The type of the plus_exprt is the type of the lhs by default. This is always the case in the code base.
1 parent ae925d4 commit f6f8e2f

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

jbmc/src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2858,7 +2858,7 @@ exprt java_bytecode_convert_methodt::convert_aload(
28582858
const member_exprt data_ptr(
28592859
deref, "data", pointer_type(java_type_from_char(type_char)));
28602860

2861-
plus_exprt data_plus_offset(data_ptr, op[1], data_ptr.type());
2861+
plus_exprt data_plus_offset{data_ptr, op[1]};
28622862
// tag it so it's easy to identify during instrumentation
28632863
data_plus_offset.set(ID_java_array_access, true);
28642864
const dereference_exprt element{data_plus_offset};
@@ -2906,7 +2906,7 @@ code_blockt java_bytecode_convert_methodt::convert_astore(
29062906
const member_exprt data_ptr(
29072907
deref, "data", pointer_type(java_type_from_char(type_char)));
29082908

2909-
plus_exprt data_plus_offset(data_ptr, op[1], data_ptr.type());
2909+
plus_exprt data_plus_offset{data_ptr, op[1]};
29102910
// tag it so it's easy to identify during instrumentation
29112911
data_plus_offset.set(ID_java_array_access, true);
29122912
const dereference_exprt element{data_plus_offset};

jbmc/src/java_bytecode/java_object_factory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ void java_object_factoryt::array_loop_init_code(
12171217
}
12181218

12191219
const dereference_exprt arraycellref{
1220-
plus_exprt{array_init_symexpr, counter_expr, array_init_symexpr.type()}};
1220+
plus_exprt{array_init_symexpr, counter_expr}};
12211221

12221222
// MUST_UPDATE_IN_PLACE only applies to this object.
12231223
// If this is a pointer to another object, offer the chance

src/analyses/goto_check.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ goto_checkt::address_check(const exprt &address, const exprt &size)
11081108

11091109
binary_relation_exprt lb_check(a.first, ID_le, int_ptr);
11101110

1111-
plus_exprt ub(int_ptr, size, int_ptr.type());
1111+
plus_exprt ub{int_ptr, size};
11121112

11131113
binary_relation_exprt ub_check(ub, ID_le, plus_exprt(a.first, a.second));
11141114

src/solvers/smt2/smt2_conv.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,7 @@ void smt2_convt::convert_address_of_rec(
561561
new_index_expr,
562562
pointer_type(array.type().subtype()));
563563

564-
plus_exprt plus_expr(
565-
address_of_expr,
566-
index,
567-
address_of_expr.type());
564+
plus_exprt plus_expr{address_of_expr, index};
568565

569566
convert_expr(plus_expr);
570567
}

0 commit comments

Comments
 (0)