@@ -54,23 +54,23 @@ class remove_exceptionst
54
54
55
55
void instrument_exception_handler (
56
56
const goto_functionst::function_mapt::iterator &,
57
- const goto_programt::instructionst::iterator &);
57
+ const goto_programt::targett &);
58
58
59
59
void add_exception_dispatch_sequence (
60
60
const goto_functionst::function_mapt::iterator &,
61
- const goto_programt::instructionst::iterator &instr_it,
61
+ const goto_programt::targett &instr_it,
62
62
const stack_catcht &stack_catch,
63
63
const std::vector<exprt> &locals);
64
64
65
65
void instrument_throw (
66
66
const goto_functionst::function_mapt::iterator &,
67
- const goto_programt::instructionst::iterator &,
67
+ const goto_programt::targett &,
68
68
const stack_catcht &,
69
69
const std::vector<exprt> &);
70
70
71
71
void instrument_function_call (
72
72
const goto_functionst::function_mapt::iterator &,
73
- const goto_programt::instructionst::iterator &,
73
+ const goto_programt::targett &,
74
74
const stack_catcht &,
75
75
const std::vector<exprt> &);
76
76
@@ -188,14 +188,14 @@ void remove_exceptionst::add_exceptional_returns(
188
188
189
189
// / Translates an exception landing-pad into instructions that copy the
190
190
// / in-flight exception pointer to a nominated expression, then clear the
191
- // / in-flight exception, hence marking it caught.
191
+ // / in-flight exception (i.e. null the pointer) , hence marking it caught.
192
192
// / \param func_it: iterator pointing to the function containing this
193
193
// / landingpad instruction
194
194
// / \param instr_it [in, out]: iterator pointing to the landingpad instruction.
195
195
// / Will be overwritten.
196
196
void remove_exceptionst::instrument_exception_handler (
197
197
const goto_functionst::function_mapt::iterator &func_it,
198
- const goto_programt::instructionst::iterator &instr_it)
198
+ const goto_programt::targett &instr_it)
199
199
{
200
200
const irep_idt &function_id=func_it->first ;
201
201
goto_programt &goto_program=func_it->second .body ;
@@ -236,8 +236,8 @@ void remove_exceptionst::instrument_exception_handler(
236
236
}
237
237
238
238
// / Emit the code:
239
- // / if (exception instanceof ExnA) then goto handlera
240
- // / else if (exception instanceof ExnB) then goto handlerb
239
+ // / if (exception instanceof ExnA) then goto handlerA
240
+ // / else if (exception instanceof ExnB) then goto handlerB
241
241
// / else goto universal_handler or (dead locals; function exit)
242
242
// / \param function_id: function instr_it belongs to
243
243
// / \param instr_it: throw or call instruction that may be an
@@ -246,7 +246,7 @@ void remove_exceptionst::instrument_exception_handler(
246
246
// / \param locals: local variables to kill on a function-exit edge
247
247
void remove_exceptionst::add_exception_dispatch_sequence (
248
248
const goto_functionst::function_mapt::iterator &func_it,
249
- const goto_programt::instructionst::iterator &instr_it,
249
+ const goto_programt::targett &instr_it,
250
250
const remove_exceptionst::stack_catcht &stack_catch,
251
251
const std::vector<exprt> &locals)
252
252
{
@@ -266,7 +266,7 @@ void remove_exceptionst::add_exception_dispatch_sequence(
266
266
267
267
// find the symbol corresponding to the caught exceptions
268
268
const symbolt &exc_symbol=
269
- symbol_table.lookup (id2string (function_id)+EXC_SUFFIX);
269
+ symbol_table.lookup (id2string (function_id)+EXC_SUFFIX);
270
270
symbol_exprt exc_thrown=exc_symbol.symbol_expr ();
271
271
272
272
// add GOTOs implementing the dynamic dispatch of the
@@ -277,7 +277,7 @@ void remove_exceptionst::add_exception_dispatch_sequence(
277
277
{
278
278
goto_programt::targett new_state_pc=
279
279
stack_catch[i][j].second ;
280
- if (stack_catch[i][j].first == irep_idt ())
280
+ if (stack_catch[i][j].first . empty ())
281
281
{
282
282
// Universal handler. Highest on the stack takes
283
283
// precedence, so overwrite any we've already seen:
@@ -318,7 +318,7 @@ void remove_exceptionst::add_exception_dispatch_sequence(
318
318
// / exception handlers
319
319
void remove_exceptionst::instrument_throw (
320
320
const goto_functionst::function_mapt::iterator &func_it,
321
- const goto_programt::instructionst::iterator &instr_it,
321
+ const goto_programt::targett &instr_it,
322
322
const remove_exceptionst::stack_catcht &stack_catch,
323
323
const std::vector<exprt> &locals)
324
324
{
@@ -356,7 +356,7 @@ void remove_exceptionst::instrument_throw(
356
356
// / GOTOS to the corresponding exception handlers
357
357
void remove_exceptionst::instrument_function_call (
358
358
const goto_functionst::function_mapt::iterator &func_it,
359
- const goto_programt::instructionst::iterator &instr_it,
359
+ const goto_programt::targett &instr_it,
360
360
const stack_catcht &stack_catch,
361
361
const std::vector<exprt> &locals)
362
362
{
@@ -366,7 +366,7 @@ void remove_exceptionst::instrument_function_call(
366
366
const irep_idt &function_id=func_it->first ;
367
367
368
368
// save the address of the next instruction
369
- goto_programt::instructionst::iterator next_it=instr_it;
369
+ goto_programt::targett next_it=instr_it;
370
370
next_it++;
371
371
372
372
code_function_callt &function_call=to_code_function_call (instr_it->code );
@@ -481,7 +481,7 @@ void remove_exceptionst::instrument_exceptions(
481
481
// the targets were unreachable (in which case no exception can truly
482
482
// be thrown at runtime)
483
483
INVARIANT (
484
- instr_it->targets .size ()== 0 ||
484
+ instr_it->targets .empty () ||
485
485
exception_list.size ()==instr_it->targets .size (),
486
486
" `exception_list` should contain current instruction's targets" );
487
487
0 commit comments