File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ bool simplify_exprt::simplify_mult(exprt &expr)
175
175
// true if we have found a constant
176
176
bool constant_found = false ;
177
177
178
- typet c_sizeof_type= nil_typet () ;
178
+ optionalt< typet> c_sizeof_type;
179
179
180
180
// scan all the operands
181
181
for (exprt::operandst::iterator it=operands.begin ();
@@ -201,7 +201,7 @@ bool simplify_exprt::simplify_mult(exprt &expr)
201
201
if (it->is_constant () && it->type ()==expr.type ())
202
202
{
203
203
// preserve the sizeof type annotation
204
- if (c_sizeof_type.is_nil ())
204
+ if (! c_sizeof_type.has_value ())
205
205
c_sizeof_type=
206
206
static_cast <const typet &>(it->find (ID_C_c_sizeof_type));
207
207
@@ -229,13 +229,13 @@ bool simplify_exprt::simplify_mult(exprt &expr)
229
229
it++; // move to the next operand
230
230
}
231
231
232
- if (c_sizeof_type.is_not_nil ())
232
+ if (c_sizeof_type.has_value ())
233
233
{
234
234
INVARIANT (
235
235
constant_found,
236
236
" c_sizeof_type is only set to a non-nil value "
237
237
" if a constant has been found" );
238
- constant->set (ID_C_c_sizeof_type, c_sizeof_type);
238
+ constant->set (ID_C_c_sizeof_type, * c_sizeof_type);
239
239
}
240
240
241
241
if (operands.size ()==1 )
You can’t perform that action at this time.
0 commit comments