anchor.diff:  valfun_1({get_tuple_element,Src,I,Dst}, Vst) ->
       assert_type({tuple_element,I+1}, Src, Vst),
       set_type_reg(term, Src, Dst, Vst);
  +valfun_1({jump,{f,Lbl}}, Vst) ->
  +    kill_state(branch_state(Lbl, Vst));
   valfun_1(I, Vst) ->
       valfun_2(I, Vst).
  +
  +init_try_catch_branch(Tag, Dst, Fail, Vst0) ->
  +    Vst1 = set_type_y({Tag,[Fail]}, Dst, Vst0),
  +    #vst{current=#st{ct=Fails}=St0} = Vst1,
  +    CurrentSt = St0#st{ct=[[Fail]|Fails]},
  +
  +    %% Set the initial state at the try/catch label.
  +    %% Assume that Y registers contain terms or try/catch
  +    %% tags.
  +    Yregs0 = map(fun({Y,uninitialized}) -> {Y,term};
  +                    ({Y,initialized}) -> {Y,term};
  +                    (E) -> E
  +                 end, gb_trees:to_list(CurrentSt#st.y)),
  +    Yregs = gb_trees:from_orddict(Yregs0),
  +    BranchSt = CurrentSt#st{y=Yregs},
  +
  +    Vst = branch_state(Fail, Vst1#vst{current=BranchSt}),
  +    Vst#vst{current=CurrentSt}.
   
   %% Update branched state if necessary and try next set of instructions.
   valfun_2(I, #vst{current=#st{ct=[]}}=Vst) ->
       valfun_3(I, Vst);
   valfun_2(I, #vst{current=#st{ct=[[Fail]|_]}}=Vst) when is_integer(Fail) ->
  -    %% Update branched state
  +    %% Update branched state.
       valfun_3(I, branch_state(Fail, Vst));
   valfun_2(_, _) ->
       error(ambiguous_catch_try_state).
  
positive.code:     kill_state(Vst);
  valfun_4(return, #vst{current=#st{numy=NumY}}) ->
      error({stack_frame,NumY});
  valfun_4({jump,{f,Lbl}}, Vst) ->
      kill_state(branch_state(Lbl, Vst));
  valfun_4({loop_rec,{f,Fail},Dst}, Vst0) ->
      Vst = branch_state(Fail, Vst0),
      %% This term may not be part of the root set until
  
negative.code: 	    error({trim,N,Remaining,allocated,NumY})
      end;
  %% Catch & try.
  valfun_1({'catch',Dst,{f,Fail}}, Vst) when Fail =/= none ->
      init_try_catch_branch(catchtag, Dst, Fail, Vst);
  valfun_1({'try',Dst,{f,Fail}}, Vst)  when Fail =/= none ->
      init_try_catch_branch(trytag, Dst, Fail, Vst);
  valfun_1({catch_end,Reg}, #vst{current=#st{ct=[Fail|Fails]}}=Vst0) ->
      case get_special_y_type(Reg, Vst0) of
  	{catchtag,Fail} ->
  	    Vst = #vst{current=St} = set_catch_end(Reg, Vst0),
              Xregs = gb_trees:enter(0, term, St#st.x),
  	    Vst#vst{current=St#st{x=Xregs,ct=Fails,fls=undefined}};
  	Type ->
  	    error({bad_type,Type})
      end;
  valfun_1({try_end,Reg}, #vst{current=#st{ct=[Fail|Fails]}=St0}=Vst) ->
      case get_special_y_type(Reg, Vst) of
  	{trytag,Fail} ->
  	    St = St0#st{ct=Fails,fls=undefined},
  	    set_catch_end(Reg, Vst#vst{current=St});
  	Type ->
  