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

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

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

      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

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

              Created:
              Updated:
              Resolved: