@@ -107,7 +107,8 @@ class remove_exceptionst
107
107
}
108
108
109
109
void operator ()(goto_functionst &goto_functions);
110
- void operator ()(goto_programt &goto_program);
110
+ void operator ()(
111
+ const irep_idt &function_identifier, goto_programt &goto_program);
111
112
112
113
protected:
113
114
symbol_table_baset &symbol_table;
@@ -132,24 +133,28 @@ class remove_exceptionst
132
133
std::size_t &universal_catch);
133
134
134
135
void add_exception_dispatch_sequence (
136
+ const irep_idt &function_identifier,
135
137
goto_programt &goto_program,
136
138
const goto_programt::targett &instr_it,
137
139
const stack_catcht &stack_catch,
138
140
const std::vector<symbol_exprt> &locals);
139
141
140
142
bool instrument_throw (
143
+ const irep_idt &function_identifier,
141
144
goto_programt &goto_program,
142
145
const goto_programt::targett &,
143
146
const stack_catcht &,
144
147
const std::vector<symbol_exprt> &);
145
148
146
149
bool instrument_function_call (
150
+ const irep_idt &function_identifier,
147
151
goto_programt &goto_program,
148
152
const goto_programt::targett &,
149
153
const stack_catcht &,
150
154
const std::vector<symbol_exprt> &);
151
155
152
156
void instrument_exceptions (
157
+ const irep_idt &function_identifier,
153
158
goto_programt &goto_program);
154
159
};
155
160
@@ -305,6 +310,7 @@ goto_programt::targett remove_exceptionst::find_universal_exception(
305
310
// / \param stack_catch: exception handlers currently registered
306
311
// / \param locals: local variables to kill on a function-exit edge
307
312
void remove_exceptionst::add_exception_dispatch_sequence (
313
+ const irep_idt &function_identifier,
308
314
goto_programt &goto_program,
309
315
const goto_programt::targett &instr_it,
310
316
const remove_exceptionst::stack_catcht &stack_catch,
@@ -357,6 +363,7 @@ void remove_exceptionst::add_exception_dispatch_sequence(
357
363
if (remove_added_instanceof)
358
364
{
359
365
remove_instanceof (
366
+ function_identifier,
360
367
t_exc,
361
368
goto_program,
362
369
symbol_table,
@@ -385,6 +392,7 @@ void remove_exceptionst::add_exception_dispatch_sequence(
385
392
// / instruments each throw with conditional GOTOS to the corresponding
386
393
// / exception handlers
387
394
bool remove_exceptionst::instrument_throw (
395
+ const irep_idt &function_identifier,
388
396
goto_programt &goto_program,
389
397
const goto_programt::targett &instr_it,
390
398
const remove_exceptionst::stack_catcht &stack_catch,
@@ -396,6 +404,7 @@ bool remove_exceptionst::instrument_throw(
396
404
uncaught_exceptions_domaint::get_exception_symbol (instr_it->code );
397
405
398
406
add_exception_dispatch_sequence (
407
+ function_identifier,
399
408
goto_program, instr_it, stack_catch, locals);
400
409
401
410
// find the symbol where the thrown exception should be stored:
@@ -416,6 +425,7 @@ bool remove_exceptionst::instrument_throw(
416
425
// / instruments each function call that may escape exceptions with conditional
417
426
// / GOTOS to the corresponding exception handlers
418
427
bool remove_exceptionst::instrument_function_call (
428
+ const irep_idt &function_identifier,
419
429
goto_programt &goto_program,
420
430
const goto_programt::targett &instr_it,
421
431
const stack_catcht &stack_catch,
@@ -450,6 +460,7 @@ bool remove_exceptionst::instrument_function_call(
450
460
else
451
461
{
452
462
add_exception_dispatch_sequence (
463
+ function_identifier,
453
464
goto_program, instr_it, stack_catch, locals);
454
465
455
466
// add a null check (so that instanceof can be applied)
@@ -470,6 +481,7 @@ bool remove_exceptionst::instrument_function_call(
470
481
// / handlers. Additionally, it re-computes the live-range of local variables in
471
482
// / order to add DEAD instructions.
472
483
void remove_exceptionst::instrument_exceptions (
484
+ const irep_idt &function_identifier,
473
485
goto_programt &goto_program)
474
486
{
475
487
stack_catcht stack_catch; // stack of try-catch blocks
@@ -566,12 +578,12 @@ void remove_exceptionst::instrument_exceptions(
566
578
else if (instr_it->type ==THROW)
567
579
{
568
580
did_something |=
569
- instrument_throw (goto_program, instr_it, stack_catch, locals);
581
+ instrument_throw (function_identifier, goto_program, instr_it, stack_catch, locals);
570
582
}
571
583
else if (instr_it->type ==FUNCTION_CALL)
572
584
{
573
585
did_something |=
574
- instrument_function_call (goto_program, instr_it, stack_catch, locals);
586
+ instrument_function_call (function_identifier, goto_program, instr_it, stack_catch, locals);
575
587
}
576
588
}
577
589
@@ -582,12 +594,14 @@ void remove_exceptionst::instrument_exceptions(
582
594
void remove_exceptionst::operator ()(goto_functionst &goto_functions)
583
595
{
584
596
Forall_goto_functions (it, goto_functions)
585
- instrument_exceptions (it->second .body );
597
+ instrument_exceptions (it->first , it-> second .body );
586
598
}
587
599
588
- void remove_exceptionst::operator ()(goto_programt &goto_program)
600
+ void remove_exceptionst::operator ()(
601
+ const irep_idt &function_identifier,
602
+ goto_programt &goto_program)
589
603
{
590
- instrument_exceptions (goto_program);
604
+ instrument_exceptions (function_identifier, goto_program);
591
605
}
592
606
593
607
// / removes throws/CATCH-POP/CATCH-PUSH
@@ -631,6 +645,7 @@ void remove_exceptions(
631
645
// / should be lowered to class-identifier comparisons (using
632
646
// / remove_instanceof).
633
647
void remove_exceptions (
648
+ const irep_idt &function_identifier,
634
649
goto_programt &goto_program,
635
650
symbol_table_baset &symbol_table,
636
651
const class_hierarchyt *class_hierarchy,
@@ -646,7 +661,7 @@ void remove_exceptions(
646
661
any_function_may_throw,
647
662
type == remove_exceptions_typest::REMOVE_ADDED_INSTANCEOF,
648
663
message_handler);
649
- remove_exceptions (goto_program);
664
+ remove_exceptions (function_identifier, goto_program);
650
665
}
651
666
652
667
// / removes throws/CATCH-POP/CATCH-PUSH, replacing them with explicit exception
0 commit comments