Skip to content

Commit fde9c76

Browse files
author
thk123
committed
Correcting assertions.
Changed assert to invariant that all components on a struct have a name. Changed assert to invariant that must and no update in places cases have been correctly dealt with.
1 parent 90c8198 commit fde9c76

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/java_bytecode/java_object_factory.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Author: Daniel Kroening, [email protected]
2020
#include <util/nondet_ifthenelse.h>
2121
#include <util/pointer_offset_size.h>
2222
#include <util/prefix.h>
23+
#include <util/invariant.h>
2324

2425
#include <linking/zero_initializer.h>
2526

@@ -481,7 +482,8 @@ void java_object_factoryt::gen_nondet_pointer_init(
481482
}
482483
else
483484
{
484-
assert(update_in_place==MAY_UPDATE_IN_PLACE);
485+
INVARIANT(update_in_place==MAY_UPDATE_IN_PLACE,
486+
"No update and must update should have already been resolved");
485487

486488
code_ifthenelset update_check;
487489
update_check.cond()=side_effect_expr_nondett(bool_typet());
@@ -559,7 +561,7 @@ void java_object_factoryt::gen_nondet_struct_init(
559561
}
560562
else
561563
{
562-
assert(!name.empty());
564+
INVARIANT(!name.empty(), "Each component of a struct must have a name");
563565

564566
bool _is_sub=name[0]=='@';
565567

0 commit comments

Comments
 (0)