@@ -569,7 +569,7 @@ codet java_bytecode_convert_methodt::get_array_bounds_check(
569
569
570
570
/* ******************************************************************\
571
571
572
- Function: get_array_access_check
572
+ Function: throw_array_access_exception
573
573
574
574
Inputs:
575
575
@@ -581,10 +581,10 @@ Function: get_array_access_check
581
581
582
582
\*******************************************************************/
583
583
584
- codet java_bytecode_convert_methodt::get_array_access_check (
584
+ codet java_bytecode_convert_methodt::throw_array_access_exception (
585
585
const exprt &array_struct,
586
586
const exprt &idx,
587
- const source_locationt &original_sloc )
587
+ const source_locationt &original_loc )
588
588
{
589
589
symbolt exc_symbol;
590
590
if (!symbol_table.has_symbol (" ArrayIndexOutOfBoundsException" ))
@@ -601,7 +601,7 @@ codet java_bytecode_convert_methodt::get_array_access_check(
601
601
602
602
const symbol_exprt &exc=exc_symbol.symbol_expr ();
603
603
side_effect_expr_throwt throw_expr;
604
- throw_expr.add_source_location ()=original_sloc ;
604
+ throw_expr.add_source_location ()=original_loc ;
605
605
throw_expr.copy_to_operands (exc);
606
606
607
607
const constant_exprt &zero=from_integer (0 , java_int_type ());
@@ -611,7 +611,7 @@ codet java_bytecode_convert_methodt::get_array_access_check(
611
611
const and_exprt and_expr (lt_zero, ge_length);
612
612
613
613
code_ifthenelset if_code;
614
- if_code.add_source_location ()=original_sloc ;
614
+ if_code.add_source_location ()=original_loc ;
615
615
if_code.cond ()=and_expr;
616
616
if_code.then_case ()=code_expressiont (throw_expr);
617
617
@@ -620,7 +620,7 @@ codet java_bytecode_convert_methodt::get_array_access_check(
620
620
621
621
/* ******************************************************************\
622
622
623
- Function: get_array_length_check
623
+ Function: throw_array_length_exception
624
624
625
625
Inputs:
626
626
@@ -630,9 +630,9 @@ Function: get_array_length_check
630
630
631
631
\*******************************************************************/
632
632
633
- codet java_bytecode_convert_methodt::get_array_length_check (
633
+ codet java_bytecode_convert_methodt::throw_array_length_exception (
634
634
const exprt &length,
635
- const source_locationt &original_sloc )
635
+ const source_locationt &original_loc )
636
636
{
637
637
symbolt exc_symbol;
638
638
if (!symbol_table.has_symbol (" NegativeArraySizeException" ))
@@ -649,23 +649,23 @@ codet java_bytecode_convert_methodt::get_array_length_check(
649
649
650
650
const symbol_exprt &exc=exc_symbol.symbol_expr ();
651
651
side_effect_expr_throwt throw_expr;
652
- throw_expr.add_source_location ()=original_sloc ;
652
+ throw_expr.add_source_location ()=original_loc ;
653
653
throw_expr.copy_to_operands (exc);
654
654
655
655
const constant_exprt &zero=from_integer (0 , java_int_type ());
656
656
const binary_relation_exprt ge_zero (length, ID_ge, zero);
657
657
658
658
code_ifthenelset if_code;
659
- if_code.add_source_location ()=original_sloc ;
659
+ if_code.add_source_location ()=original_loc ;
660
660
if_code.cond ()=ge_zero;
661
661
if_code.then_case ()=code_expressiont (throw_expr);
662
-
662
+
663
663
return if_code;
664
664
}
665
665
666
666
/* ******************************************************************\
667
667
668
- Function: get_null_dereference_check
668
+ Function: throw_null_dereference_exception
669
669
670
670
Inputs:
671
671
@@ -676,9 +676,9 @@ Function: get_null_dereference_check
676
676
677
677
\*******************************************************************/
678
678
679
- codet java_bytecode_convert_methodt::get_null_dereference_check (
679
+ codet java_bytecode_convert_methodt::throw_null_dereference_exception (
680
680
const exprt &expr,
681
- const source_locationt &original_sloc )
681
+ const source_locationt &original_loc )
682
682
{
683
683
symbolt exc_symbol;
684
684
if (!symbol_table.has_symbol (" NullPointerException" ))
@@ -695,14 +695,14 @@ codet java_bytecode_convert_methodt::get_null_dereference_check(
695
695
696
696
const symbol_exprt &exc=exc_symbol.symbol_expr ();
697
697
side_effect_expr_throwt throw_expr;
698
- throw_expr.add_source_location ()=original_sloc ;
698
+ throw_expr.add_source_location ()=original_loc ;
699
699
throw_expr.copy_to_operands (exc);
700
700
701
701
const equal_exprt equal_expr (
702
702
expr,
703
703
null_pointer_exprt (pointer_typet (empty_typet ())));
704
704
code_ifthenelset if_code;
705
- if_code.add_source_location ()=original_sloc ;
705
+ if_code.add_source_location ()=original_loc ;
706
706
if_code.cond ()=equal_expr;
707
707
if_code.then_case ()=code_expressiont (throw_expr);
708
708
@@ -711,7 +711,7 @@ codet java_bytecode_convert_methodt::get_null_dereference_check(
711
711
712
712
/* ******************************************************************\
713
713
714
- Function: get_class_cast_check
714
+ Function: throw_class_cast_exception
715
715
716
716
Inputs:
717
717
@@ -721,10 +721,10 @@ Function: get_class_cast_check
721
721
722
722
\*******************************************************************/
723
723
724
- codet java_bytecode_convert_methodt::get_class_cast_check (
724
+ codet java_bytecode_convert_methodt::throw_class_cast_exception (
725
725
const exprt &class1,
726
726
const exprt &class2,
727
- const source_locationt &original_sloc )
727
+ const source_locationt &original_loc )
728
728
{
729
729
// TODO: use std::move
730
730
symbolt exc_symbol;
@@ -743,7 +743,7 @@ codet java_bytecode_convert_methodt::get_class_cast_check(
743
743
const symbol_exprt &exc=exc_symbol.symbol_expr ();
744
744
745
745
side_effect_expr_throwt throw_expr;
746
- throw_expr.add_source_location ()=original_sloc ;
746
+ throw_expr.add_source_location ()=original_loc ;
747
747
throw_expr.copy_to_operands (exc);
748
748
749
749
binary_predicate_exprt class_cast_check (
@@ -760,7 +760,7 @@ codet java_bytecode_convert_methodt::get_class_cast_check(
760
760
and_exprt and_expr (op_not_null, class_cast_check);
761
761
762
762
code_ifthenelset if_code;
763
- if_code.add_source_location ()=original_sloc ;
763
+ if_code.add_source_location ()=original_loc ;
764
764
if_code.cond ()=and_expr;
765
765
if_code.then_case ()=code_expressiont (throw_expr);
766
766
@@ -1561,9 +1561,10 @@ codet java_bytecode_convert_methodt::convert_instructions(
1561
1561
code_blockt block;
1562
1562
if (throw_runtime_exceptions)
1563
1563
{
1564
- codet null_dereference_check=get_null_dereference_check (
1565
- op[0 ],
1566
- i_it->source_location );
1564
+ codet null_dereference_check=
1565
+ throw_null_dereference_exception (
1566
+ op[0 ],
1567
+ i_it->source_location );
1567
1568
block.move_to_operands (null_dereference_check);
1568
1569
}
1569
1570
else
@@ -1598,7 +1599,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
1598
1599
if (throw_runtime_exceptions)
1599
1600
{
1600
1601
codet conditional_check=
1601
- get_class_cast_check (op[0 ], arg0, i_it->source_location );
1602
+ throw_class_cast_exception (op[0 ], arg0, i_it->source_location );
1602
1603
c=std::move (conditional_check);
1603
1604
}
1604
1605
else
@@ -1844,13 +1845,9 @@ codet java_bytecode_convert_methodt::convert_instructions(
1844
1845
const dereference_exprt element (data_plus_offset, element_type);
1845
1846
1846
1847
c=code_blockt ();
1847
- codet bounds_check;
1848
- if (throw_runtime_exceptions)
1849
- bounds_check=
1850
- get_array_access_check (deref, op[1 ], i_it->source_location );
1851
- else
1852
- bounds_check=
1853
- get_array_bounds_check (deref, op[1 ], i_it->source_location );
1848
+ codet bounds_check=throw_runtime_exceptions?
1849
+ throw_array_access_exception (deref, op[1 ], i_it->source_location ):
1850
+ get_array_bounds_check (deref, op[1 ], i_it->source_location );
1854
1851
1855
1852
bounds_check.add_source_location ()=i_it->source_location ;
1856
1853
c.move_to_operands (bounds_check);
@@ -2460,7 +2457,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
2460
2457
2461
2458
if (throw_runtime_exceptions)
2462
2459
{
2463
- codet array_length_check=get_array_length_check (
2460
+ codet array_length_check=throw_array_length_exception (
2464
2461
op[0 ],
2465
2462
i_it->source_location );
2466
2463
c.move_to_operands (array_length_check);
@@ -2509,7 +2506,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
2509
2506
c=code_blockt ();
2510
2507
if (throw_runtime_exceptions)
2511
2508
{
2512
- codet array_length_check=get_array_length_check (
2509
+ codet array_length_check=throw_array_length_exception (
2513
2510
op[0 ],
2514
2511
i_it->source_location );
2515
2512
c.move_to_operands (array_length_check);
0 commit comments