Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-361

Negative-id arguments and negative-id exceptions use the same counter

    XMLWordPrintableJSON

Details

    • Patch Available

    Description

      If a function has negative (implicit) id fields in both its argument list and exception list, like

        i32 ret_neg(i32 arg1, i32 arg2) throws (MixedEx1 ex1, MixedEx2 ex2);
      

      then the same counter is used to assign field ids to both the arguments and exceptions. This is bad because the addition of a new argument will renumber the exceptions, breaking wire compatibility. The soon-to-be-uploaded patch fixes this be resetting the counter at the start of any field list. This will break wire-compatibility one time (and only with functions that have both negative-id arguments and negative id-exceptions, and only in the exceptional case), but will prevent future sudden breakages, so I think it is worth it.

      Attachments

        Activity

          People

            dreiss David Reiss
            dreiss David Reiss
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: