@@ -228,7 +228,7 @@ void remove_exceptionst::instrument_exception_handler(
228228 const goto_programt::targett &instr_it,
229229 bool may_catch)
230230{
231- PRECONDITION (instr_it->type == CATCH);
231+ PRECONDITION (instr_it->type () == CATCH);
232232
233233 if (may_catch)
234234 {
@@ -404,7 +404,7 @@ bool remove_exceptionst::instrument_throw(
404404 const remove_exceptionst::stack_catcht &stack_catch,
405405 const std::vector<symbol_exprt> &locals)
406406{
407- PRECONDITION (instr_it->type == THROW);
407+ PRECONDITION (instr_it->type () == THROW);
408408
409409 const exprt &exc_expr =
410410 uncaught_exceptions_domaint::get_exception_symbol (instr_it->get_code ());
@@ -416,13 +416,11 @@ bool remove_exceptionst::instrument_throw(
416416 symbol_exprt exc_thrown =
417417 get_inflight_exception_global ();
418418
419- // add the assignment with the appropriate cast
420- code_assignt assignment (
419+ // now turn the `throw' into an assignment with the appropriate cast
420+ *instr_it = goto_programt::make_assignment (
421421 exc_thrown,
422- typecast_exprt (exc_expr, exc_thrown.type ()));
423- // now turn the `throw' into `assignment'
424- instr_it->type =ASSIGN;
425- instr_it->code_nonconst () = assignment;
422+ typecast_exprt (exc_expr, exc_thrown.type ()),
423+ instr_it->source_location ());
426424
427425 return true ;
428426}
@@ -437,7 +435,7 @@ remove_exceptionst::instrument_function_call(
437435 const stack_catcht &stack_catch,
438436 const std::vector<symbol_exprt> &locals)
439437{
440- PRECONDITION (instr_it->type == FUNCTION_CALL);
438+ PRECONDITION (instr_it->type () == FUNCTION_CALL);
441439
442440 // save the address of the next instruction
443441 goto_programt::targett next_it=instr_it;
@@ -512,7 +510,7 @@ void remove_exceptionst::instrument_exceptions(
512510 locals.push_back (instr_it->decl_symbol ());
513511 }
514512 // Is it a handler push/pop or catch landing-pad?
515- else if (instr_it->type == CATCH)
513+ else if (instr_it->type () == CATCH)
516514 {
517515 const irep_idt &statement = instr_it->get_code ().get_statement ();
518516 // Is it an exception landing pad (start of a catch block)?
@@ -584,12 +582,12 @@ void remove_exceptionst::instrument_exceptions(
584582 instr_it->turn_into_skip ();
585583 did_something = true ;
586584 }
587- else if (instr_it->type == THROW)
585+ else if (instr_it->type () == THROW)
588586 {
589587 did_something = instrument_throw (
590588 function_identifier, goto_program, instr_it, stack_catch, locals);
591589 }
592- else if (instr_it->type == FUNCTION_CALL)
590+ else if (instr_it->type () == FUNCTION_CALL)
593591 {
594592 instrumentation_resultt result =
595593 instrument_function_call (
0 commit comments