Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-9395

Pass 'dsk' and 'end' in as parameters to WT_CELL_LEN_CHK

    XMLWordPrintable

Details

    • 1
    • Storage Engines - 2022-06-27, Storage Engines - 2022-07-11

    Description

      Summary
      The WT_CELL_LEN_CHK macro takes two parameters, t and len. It also assumes that two variable called dsk and end are available in scope. This looks like a mistake made during major refactoring. This ticket will add dsk and end as extra parameters to the macro (the macro body will remain unchanged).

      If this macro had been written as an inline function instead, this issue could not have arisen, as the compiler would have detected that dsk and end were not declared.

      Motivation

      • Does this affect any team outside of WT?
        No
      • How likely is it that this use case or problem will occur?
        The code currently works correctly, but this problem has created code that is unnecessarily opaque, 
      • If the problem does occur, what are the consequences and how severe are they?
        It increases the chance of bugs being introduced should the code be changed subsequently.
      • Is this issue urgent?
        No

      Acceptance Criteria (Definition of Done)
      When the macro, and all calls to the macro, have been updated.

      • Testing
        The fix is simple, and so existing PR and post-merge tests are sufficient.
      • Documentation update
        N/a

      Attachments

        Activity

          People

            chenhao.qu@mongodb.com Chenhao Qu
            jeremy.thorp@mongodb.com Jeremy Thorp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: