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

OCaml libraries don't compile with 32-bit ocaml

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7
    • Labels:
      None
    • Environment:

      OCaml 3.10.2 (32-bit)

      Description

      TBinaryProtocol.ml contains integers outside the range of 32-bit OCaml's native int type (specifically the version_mask and version_1). Additionally, when reading int32s off of the network it returns them as OCaml-native ints. This will behave wrong when an int >= 2**30 is sent over the network, as that will wrap on the OCaml side. I assume the author of this code used 64-bit OCaml, as the code won't even compile under 32-bit OCaml right now.

      In TBinaryProtocol 64-bit ints are kept as int64 objects. The same should be done with 32-bit int values.

        Attachments

        1. int32patch
          10 kB
          John Billings
        2. int32patch
          9 kB
          Iain Proctor

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kballard Kevin Ballard
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: