anchor.diff:  	    error({trim,N,Remaining,allocated,NumY})
       end;
   %% Catch & try.
  -valfun_1({'catch',Dst,{f,Fail}}, Vst0) when Fail /= none ->
  -    Vst = #vst{current=#st{ct=Fails}=St} = 
  -	set_type_y({catchtag,[Fail]}, Dst, Vst0),
  -    Vst#vst{current=St#st{ct=[[Fail]|Fails]}};
  -valfun_1({'try',Dst,{f,Fail}}, Vst0) ->
  -    Vst = #vst{current=#st{ct=Fails}=St} = 
  -	set_type_y({trytag,[Fail]}, Dst, Vst0),
  -    Vst#vst{current=St#st{ct=[[Fail]|Fails]}};
  +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),
  -	    Xs = gb_trees_from_list([{0,term}]),
  -	    Vst#vst{current=St#st{x=Xs,ct=Fails,fls=undefined}};
  +            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}=Vst0) ->
  -    case get_special_y_type(Reg, Vst0) of
  +valfun_1({try_end,Reg}, #vst{current=#st{ct=[Fail|Fails]}=St0}=Vst) ->
  +    case get_special_y_type(Reg, Vst) of
   	{trytag,Fail} ->
  -	    Vst = case Fail of
  -		      [FailLabel] -> branch_state(FailLabel, Vst0);
  -		      _ -> Vst0
  -		  end,
   	    St = St0#st{ct=Fails,fls=undefined},
   	    set_catch_end(Reg, Vst#vst{current=St});
   	Type ->
  
positive.code: 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(I, Vst) ->
      valfun_2(I, Vst).
  
  %% 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
      valfun_3(I, branch_state(Fail, Vst));
  valfun_2(_, _) ->
      error(ambiguous_catch_try_state).
  
negative.code:     Vst#vst{current=St#st{setelem=false}};
  val_dsetel(_, Vst) -> Vst.
  
  kill_state(Vst) ->
      Vst#vst{current=none}.
  
  %% A "plain" call.
  