anchor.diff:              decode_field(Rest2, MsgDef, MsgDefs, NewMsg)
       end;
   decode_field(<<>>, MsgDef, _MsgDefs, {MsgName, Fields}) ->
  -    %% Reverse any repeated fields.
  +    %% Reverse any repeated fields, but only on the top-level, not recursively.
       RepeatedFNames = [N || #field{name=N, occurrence=repeated} <- MsgDef],
       {MsgName, lists:foldl(fun(FName, Acc) ->
                                     OldValue = keyfetch(FName, Acc),
  
positive.code:                                        occurrence=required, opts=[]}]},
                      {{msg,t2}, [#field{name=b, fnum=1, type=uint32,
                                         occurrence=required, opts=[]}]}]).
  
negative.code:         undefined ->
              replace_field(FName, NewMsg, Fields);
          {FMsgName, _PrevFields} = PrevMsg ->
              MergedMsg = merge_msgs(PrevMsg, NewMsg, MsgDefs),
              replace_field(FName, MergedMsg, Fields)
      end.
  
  merge_msgs({MsgName, PrevFields}, {MsgName, NewFields}, MsgDefs) ->
      MsgDef = keyfetch({msg,MsgName}, MsgDefs),
      {MsgName,
       lists:foldl(
  