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

c_glib service does not handle negative Thrift byte values correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • C glib - Compiler
    • None
    • Patch Available

    Description

      There's a problematic type cast in generated c_glib service code that treat the sign bit of gint8 as normal bit (i.e. 128).
      The problem is illustrated as follows.

      int i = 0;
      users_handler_func((*gint8)&i);  // Suppose this function tries to set i to -100
      store_handler_result(i);         // This stores 156, not -100
      

      Attachments

        Activity

          People

            nsuke Nobuaki Sukegawa
            nsuke Nobuaki Sukegawa
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: