anchor.diff:  -include("beam_types.hrl").
   
   -define(UNICODE_MAX, (16#10FFFF)).
  +
  +%% When an instruction throws an exception it does so by branching (branch/4)
  +%% to this label, following the {f,0} convention used in BIFs.
  +%%
  +%% Instructions that have fail labels but cannot throw exceptions should guard
  +%% themselves with assert_no_exception/1, and instructions that are statically
  +%% guaranteed not to fail should simply skip branching.
   -define(EXCEPTION_LABEL, 0).
   
   -compile({no_auto_import,[min/2]}).
  
positive.code:     Type = #t_tuple{exact=true,size=Sz,elements=Es},
      type_test(Lbl, Type, Src, Vst);
  vi_safe({test,is_eq_exact,{f,Lbl},[Src,Val]=Ss}, Vst) ->
      validate_src(Ss, Vst),
      branch(Lbl, Vst,
             fun(FailVst) ->
  
negative.code: validate_var_info([], _Reg, Vst) ->
      Vst.
  
  %% Tail call.
  %%  The stackframe must have a known size and be initialized.
  %%  Does not return to the instruction following the call.
  validate_tail_call(Deallocate, Func, Live, #vst{current=#st{numy=NumY}}=Vst0) ->
      assert_float_checked(Vst0),
  
      verify_y_init(Vst0),
      verify_live(Live, Vst0),
      verify_call_args(Func, Live, Vst0),
  
      case will_call_succeed(Func, Vst0) of
          yes when Deallocate =:= NumY ->
              %% The call cannot fail; we don't need to handle exceptions
              Vst = deallocate(Vst0),
              verify_return(Vst);
          maybe when Deallocate =:= NumY ->
              %% The call may fail; make sure we update exception state
              Vst = deallocate(Vst0),
              branch(?EXCEPTION_LABEL, Vst, fun verify_return/1);
          no ->
              %% Note that the compiler is allowed to emit garbage values for
              %% "Deallocate" as we know that it will not be used in this case.
              branch(?EXCEPTION_LABEL, Vst0, fun kill_state/1);
          _ when Deallocate =/= NumY ->
              error({allocated, NumY})
      end.
  
  %% A "plain" call.
  %%  The stackframe must be initialized.
  %%  The instruction will return to the instruction following the call.
  validate_body_call(Func, Live,
                     #vst{current=#st{numy=NumY}}=Vst) when is_integer(NumY)->
      assert_float_checked(Vst),
  
      verify_y_init(Vst),
      verify_live(Live, Vst),
      verify_call_args(Func, Live, Vst),
  
      SuccFun = fun(#vst{current=St0}=SuccVst0) -> 
                        {RetType, _, _} = call_types(Func, Live, SuccVst0),
                        true = RetType =/= none,  %Assertion.
  
                        St = St0#st{f=init_fregs()},
                        SuccVst = prune_x_regs(0, SuccVst0#vst{current=St}),
  
                        create_term(RetType, call, [], {x,0}, SuccVst)
                end,
  
      case will_call_succeed(Func, Vst) of
          yes ->
              SuccFun(Vst);
          maybe ->
              branch(?EXCEPTION_LABEL, Vst, SuccFun);
          no ->
              branch(?EXCEPTION_LABEL, Vst, fun kill_state/1)
      end;
  validate_body_call(_, _, #vst{current=#st{numy=NumY}}) ->
      error({allocated, NumY}).
  