Skip to content

Commit 18714d5

Browse files
Added more comments
1 parent 30e7349 commit 18714d5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,6 +1558,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
15581558
code_blockt block;
15591559
if(throw_runtime_exceptions)
15601560
{
1561+
// throw NullPointerException if necessary
15611562
codet null_dereference_check=
15621563
throw_null_dereference_exception(
15631564
op[0],
@@ -1566,6 +1567,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
15661567
}
15671568
else
15681569
{
1570+
// add assertion
15691571
const typecast_exprt lhs(op[0], pointer_typet(empty_typet()));
15701572
const exprt rhs(null_pointer_exprt(to_pointer_type(lhs.type())));
15711573
const exprt not_equal_null(
@@ -1596,12 +1598,14 @@ codet java_bytecode_convert_methodt::convert_instructions(
15961598

15971599
if(throw_runtime_exceptions)
15981600
{
1601+
// throw ClassCastException
15991602
codet conditional_check=
16001603
throw_class_cast_exception(op[0], arg0, i_it->source_location);
16011604
c=std::move(conditional_check);
16021605
}
16031606
else
16041607
{
1608+
// add assertion
16051609
binary_predicate_exprt check(op[0], ID_java_instanceof, arg0);
16061610
code_assertt assert_class(check);
16071611
assert_class.add_source_location().
@@ -2334,6 +2338,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
23342338
assert(op.size()==1 && results.size()==1);
23352339
if(throw_runtime_exceptions)
23362340
{
2341+
// throw NullPointerException if necessary
23372342
codet null_dereference_check=
23382343
throw_null_dereference_exception(
23392344
op[0],
@@ -2369,6 +2374,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
23692374
assert(op.size()==2 && results.size()==0);
23702375
if(throw_runtime_exceptions)
23712376
{
2377+
// throw NullPointerException if necessary
23722378
codet null_dereference_check=
23732379
throw_null_dereference_exception(
23742380
op[0],

0 commit comments

Comments
 (0)