Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-3682

v1 index equality comparison does not compare positive and negative zero as equal

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL

      We just check equality of doubles using their bits, but +/- 0 have different bit representations and should compare equal.

      case coid:
      if( ((unsigned) l) != ((unsigned) r) )
      return false;
      l += 4; r += 4;
      case cdate:
      case cdouble:
      if( *((unsigned long long *) l) != *((unsigned long long *) r) )
      return false;
      l += 8; r += 8;
      break;

      I wrote a test, will push it once buildbot is working.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: