@@ -98,7 +98,8 @@ class remove_exceptionst
98
98
}
99
99
100
100
void operator ()(goto_functionst &goto_functions);
101
- void operator ()(goto_programt &goto_program);
101
+ void operator ()(
102
+ const irep_idt &function_identifier, goto_programt &goto_program);
102
103
103
104
protected:
104
105
symbol_table_baset &symbol_table;
@@ -122,24 +123,28 @@ class remove_exceptionst
122
123
std::size_t &universal_catch);
123
124
124
125
void add_exception_dispatch_sequence (
126
+ const irep_idt &function_identifier,
125
127
goto_programt &goto_program,
126
128
const goto_programt::targett &instr_it,
127
129
const stack_catcht &stack_catch,
128
130
const std::vector<exprt> &locals);
129
131
130
132
bool instrument_throw (
133
+ const irep_idt &function_identifier,
131
134
goto_programt &goto_program,
132
135
const goto_programt::targett &,
133
136
const stack_catcht &,
134
137
const std::vector<exprt> &);
135
138
136
139
bool instrument_function_call (
140
+ const irep_idt &function_identifier,
137
141
goto_programt &goto_program,
138
142
const goto_programt::targett &,
139
143
const stack_catcht &,
140
144
const std::vector<exprt> &);
141
145
142
146
void instrument_exceptions (
147
+ const irep_idt &function_identifier,
143
148
goto_programt &goto_program);
144
149
};
145
150
@@ -295,6 +300,7 @@ goto_programt::targett remove_exceptionst::find_universal_exception(
295
300
// / \param stack_catch: exception handlers currently registered
296
301
// / \param locals: local variables to kill on a function-exit edge
297
302
void remove_exceptionst::add_exception_dispatch_sequence (
303
+ const irep_idt &function_identifier,
298
304
goto_programt &goto_program,
299
305
const goto_programt::targett &instr_it,
300
306
const remove_exceptionst::stack_catcht &stack_catch,
@@ -345,7 +351,7 @@ void remove_exceptionst::add_exception_dispatch_sequence(
345
351
t_exc->guard =check;
346
352
347
353
if (remove_added_instanceof)
348
- remove_instanceof (t_exc, goto_program, symbol_table, message_handler);
354
+ remove_instanceof (function_identifier, t_exc, goto_program, symbol_table, message_handler);
349
355
}
350
356
}
351
357
}
@@ -368,6 +374,7 @@ void remove_exceptionst::add_exception_dispatch_sequence(
368
374
// / instruments each throw with conditional GOTOS to the corresponding
369
375
// / exception handlers
370
376
bool remove_exceptionst::instrument_throw (
377
+ const irep_idt &function_identifier,
371
378
goto_programt &goto_program,
372
379
const goto_programt::targett &instr_it,
373
380
const remove_exceptionst::stack_catcht &stack_catch,
@@ -379,6 +386,7 @@ bool remove_exceptionst::instrument_throw(
379
386
uncaught_exceptions_domaint::get_exception_symbol (instr_it->code );
380
387
381
388
add_exception_dispatch_sequence (
389
+ function_identifier,
382
390
goto_program, instr_it, stack_catch, locals);
383
391
384
392
// find the symbol where the thrown exception should be stored:
@@ -399,6 +407,7 @@ bool remove_exceptionst::instrument_throw(
399
407
// / instruments each function call that may escape exceptions with conditional
400
408
// / GOTOS to the corresponding exception handlers
401
409
bool remove_exceptionst::instrument_function_call (
410
+ const irep_idt &function_identifier,
402
411
goto_programt &goto_program,
403
412
const goto_programt::targett &instr_it,
404
413
const stack_catcht &stack_catch,
@@ -433,6 +442,7 @@ bool remove_exceptionst::instrument_function_call(
433
442
else
434
443
{
435
444
add_exception_dispatch_sequence (
445
+ function_identifier,
436
446
goto_program, instr_it, stack_catch, locals);
437
447
438
448
// add a null check (so that instanceof can be applied)
@@ -453,6 +463,7 @@ bool remove_exceptionst::instrument_function_call(
453
463
// / handlers. Additionally, it re-computes the live-range of local variables in
454
464
// / order to add DEAD instructions.
455
465
void remove_exceptionst::instrument_exceptions (
466
+ const irep_idt &function_identifier,
456
467
goto_programt &goto_program)
457
468
{
458
469
stack_catcht stack_catch; // stack of try-catch blocks
@@ -549,12 +560,12 @@ void remove_exceptionst::instrument_exceptions(
549
560
else if (instr_it->type ==THROW)
550
561
{
551
562
did_something |=
552
- instrument_throw (goto_program, instr_it, stack_catch, locals);
563
+ instrument_throw (function_identifier, goto_program, instr_it, stack_catch, locals);
553
564
}
554
565
else if (instr_it->type ==FUNCTION_CALL)
555
566
{
556
567
did_something |=
557
- instrument_function_call (goto_program, instr_it, stack_catch, locals);
568
+ instrument_function_call (function_identifier, goto_program, instr_it, stack_catch, locals);
558
569
}
559
570
}
560
571
@@ -565,12 +576,14 @@ void remove_exceptionst::instrument_exceptions(
565
576
void remove_exceptionst::operator ()(goto_functionst &goto_functions)
566
577
{
567
578
Forall_goto_functions (it, goto_functions)
568
- instrument_exceptions (it->second .body );
579
+ instrument_exceptions (it->first , it-> second .body );
569
580
}
570
581
571
- void remove_exceptionst::operator ()(goto_programt &goto_program)
582
+ void remove_exceptionst::operator ()(
583
+ const irep_idt &function_identifier,
584
+ goto_programt &goto_program)
572
585
{
573
- instrument_exceptions (goto_program);
586
+ instrument_exceptions (function_identifier, goto_program);
574
587
}
575
588
576
589
// / removes throws/CATCH-POP/CATCH-PUSH
@@ -610,6 +623,7 @@ void remove_exceptions(
610
623
// / should be lowered to class-identifier comparisons (using
611
624
// / remove_instanceof).
612
625
void remove_exceptions (
626
+ const irep_idt &function_identifier,
613
627
goto_programt &goto_program,
614
628
symbol_table_baset &symbol_table,
615
629
message_handlert &message_handler,
@@ -623,7 +637,7 @@ void remove_exceptions(
623
637
any_function_may_throw,
624
638
type == remove_exceptions_typest::REMOVE_ADDED_INSTANCEOF,
625
639
message_handler);
626
- remove_exceptions (goto_program);
640
+ remove_exceptions (function_identifier, goto_program);
627
641
}
628
642
629
643
// / removes throws/CATCH-POP/CATCH-PUSH
0 commit comments