Make all BSONElement accessors validate that the type is as expected

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Programmability
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, BSONElement accessors do not validate that the type expected by the API matches the actual contents of the referred-to element. Identify a way to add type checking to BSONElement accessors with an acceptable performance overhead. To maximize chance of success, we can consider it a programmer error to call accessors in a type-mismatched fashion and use tassert or low-overhead server-aborting mechanisms like MONGO_UNREACHABLE or __builtin_trap().

            Assignee:
            Unassigned
            Reporter:
            James Bronsted
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: