anchor.diff:        Terminator :: beam_ssa:terminator(),
         From :: beam_ssa:label(),
         State :: #vvars{}.
  -vvars_terminator(#b_ret{ arg = Arg }=I, _From, State) ->
  +vvars_terminator(#b_ret{ arg = Arg }=I, From, State) ->
       ok = vvars_assert_args([Arg], I, State),
  -    State;
  +    TryTags = State#vvars.try_tags,
  +    case gb_sets:size(TryTags) of
  +        N when N > 0, From =/= ?EXCEPTION_BLOCK ->
  +            throw({active_try_tags_on_return, TryTags, I});
  +        N when N > 0, From =:= ?EXCEPTION_BLOCK ->
  +            %% Plain guards sometimes branch off to ?EXCEPTION_BLOCK even
  +            %% though they cannot actually throw exceptions. This ought to be
  +            %% fixed at the source, but we'll ignore this for now.
  +            State;
  +        0 ->
  +            State
  +    end;
   vvars_terminator(#b_switch{arg=Arg,fail=Fail,list=Switch}=I, From, State) ->
       ok = vvars_assert_args([Arg], I, State),
       ok = vvars_assert_args([A || {A,_Lbl} <- Switch], I, State),
  
positive.code:       Id :: beam_ssa:label(),
        I :: beam_ssa:b_set(),
        State :: #vvars{}.
  vvars_assert_phi_vars(Phis, I, Id, #vvars{blocks=Blocks,
                                            branch_def_vars=BranchDefVars}) ->
      Vars = [{Var, From} || {#b_var{}=Var, From} <- Phis],
      foreach(fun({Var, From}) ->
                      BranchKey = {From, Id},
                      case BranchDefVars of
                          #{BranchKey:=DefVars} ->
                              case gb_sets:is_member(Var, DefVars) of
                                  true -> ok;
                                  false -> throw({unknown_variable, Var, I})
                              end;
                          #{} ->
                              throw({unknown_phi_variable, Var, BranchKey, I})
                      end
              end, Vars),
      Labels = [From || {#b_literal{},From} <- Phis],
      foreach(fun(Label) ->
                      case Blocks of
  
negative.code:       State :: #vvars{}.
  vvars_block(Id, State0) ->
      #{ Id := #b_blk{ is = Is, last = Terminator} } = State0#vvars.blocks,
      #{ Id := {Vars, TryTags} } = State0#vvars.branches,
      validate_normalized(Terminator),
      State = State0#vvars{ variables = Vars, try_tags = TryTags },
      vvars_terminator(Terminator, Id, vvars_block_1(Is, Terminator, State)).
  
  validate_normalized(I) ->
  