Skip to content

Commit 17db86d

Browse files
author
Owen Jones
committed
Refactor java object factory
Functionally equivalent, but uses RAII. Also more concise. Makes code match master, which will make merging easier.
1 parent 11402da commit 17db86d

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/java_bytecode/java_object_factory.cpp

+4-11
Original file line numberDiff line numberDiff line change
@@ -464,19 +464,12 @@ void java_object_factoryt::gen_nondet_init(
464464
}
465465
else
466466
{
467-
code_assignt assign;
468-
assign.lhs()=expr;
467+
exprt rhs=type.id()==ID_c_bool?
468+
get_nondet_bool(type):
469+
side_effect_expr_nondett(type);
470+
code_assignt assign(expr, rhs);
469471
assign.add_source_location()=loc;
470472

471-
if(type.id()==ID_c_bool)
472-
{
473-
assign.rhs()=get_nondet_bool(type);
474-
}
475-
else
476-
{
477-
assign.rhs()=side_effect_expr_nondett(type);
478-
}
479-
480473
init_code.copy_to_operands(assign);
481474
}
482475
}

0 commit comments

Comments
 (0)