File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -229,14 +229,15 @@ code_ifthenelset java_bytecode_instrumentt::check_class_cast(
229
229
if (null_check_op.type ()!=voidptr)
230
230
null_check_op.make_typecast (voidptr);
231
231
232
- codet check_code;
233
232
if (throw_runtime_exceptions)
234
233
{
235
- check_code=
234
+ return code_ifthenelset (
235
+ notequal_exprt (
236
+ std::move (null_check_op), null_pointer_exprt (std::move (voidptr))),
236
237
throw_exception (
237
238
not_exprt (class_cast_check),
238
239
original_loc,
239
- " java.lang.ClassCastException" );
240
+ " java.lang.ClassCastException" )) ;
240
241
}
241
242
else
242
243
{
@@ -246,12 +247,11 @@ code_ifthenelset java_bytecode_instrumentt::check_class_cast(
246
247
247
248
codet assert_class = create_fatal_assertion (class_cast_check, check_loc);
248
249
249
- check_code=std::move (assert_class);
250
+ return code_ifthenelset (
251
+ notequal_exprt (
252
+ std::move (null_check_op), null_pointer_exprt (std::move (voidptr))),
253
+ std::move (assert_class));
250
254
}
251
-
252
- return code_ifthenelset (
253
- notequal_exprt (std::move (null_check_op), null_pointer_exprt (voidptr)),
254
- std::move (check_code));
255
255
}
256
256
257
257
// / Checks whether \p expr is null and throws NullPointerException/
You can’t perform that action at this time.
0 commit comments