@@ -35,7 +35,7 @@ class java_bytecode_instrumentt:public messaget
35
35
{
36
36
}
37
37
38
- void operator ()(exprt &expr );
38
+ void operator ()(codet &code );
39
39
40
40
protected:
41
41
symbol_table_baset &symbol_table;
@@ -69,7 +69,7 @@ class java_bytecode_instrumentt:public messaget
69
69
const exprt &length,
70
70
const source_locationt &original_loc);
71
71
72
- void instrument_code (exprt &expr );
72
+ void instrument_code (codet &code );
73
73
void add_expr_instrumentation (code_blockt &block, const exprt &expr);
74
74
void prepend_instrumentation (codet &code, code_blockt &instrumentation);
75
75
optionalt<codet> instrument_expr (const exprt &expr);
@@ -358,9 +358,8 @@ void java_bytecode_instrumentt::prepend_instrumentation(
358
358
// / Augments `expr` with instrumentation in the form of either
359
359
// / assertions or runtime exceptions
360
360
// / \param `expr` the expression to be instrumented
361
- void java_bytecode_instrumentt::instrument_code (exprt &expr )
361
+ void java_bytecode_instrumentt::instrument_code (codet &code )
362
362
{
363
- codet &code=to_code (expr);
364
363
source_locationt old_source_location=code.source_location ();
365
364
366
365
const irep_idt &statement=code.get_statement ();
@@ -560,9 +559,9 @@ optionalt<codet> java_bytecode_instrumentt::instrument_expr(const exprt &expr)
560
559
561
560
// / Instruments `expr`
562
561
// / \param expr: the expression to be instrumented
563
- void java_bytecode_instrumentt::operator ()(exprt &expr )
562
+ void java_bytecode_instrumentt::operator ()(codet &code )
564
563
{
565
- instrument_code (expr );
564
+ instrument_code (code );
566
565
}
567
566
568
567
// / Instruments the code attached to `symbol` with
@@ -591,7 +590,7 @@ void java_bytecode_instrument_symbol(
591
590
" java_bytecode_instrument expects a code-typed symbol but was called with"
592
591
" " + id2string (symbol.name ) + " which has a value with an id of " +
593
592
id2string (symbol.value .id ()));
594
- instrument (symbol.value );
593
+ instrument (to_code ( symbol.value ) );
595
594
}
596
595
597
596
// / Instruments all the code in the symbol_table with
@@ -624,5 +623,5 @@ void java_bytecode_instrument(
624
623
// instrument(...) can add symbols to the table, so it's
625
624
// not safe to hold a reference to a symbol across a call.
626
625
for (const auto &symbol : symbols_to_instrument)
627
- instrument (symbol_table.get_writeable_ref (symbol).value );
626
+ instrument (to_code ( symbol_table.get_writeable_ref (symbol).value ) );
628
627
}
0 commit comments