[all-commits] [llvm/llvm-project] 68b890: [Clang[NFC] Fix bitmask for NullabilityPayload in ...

Shivam Gupta via All-commits all-commits at lists.llvm.org
Mon Jan 23 06:48:06 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 68b890831615fc4350a47cf7ec404156128d03ac
      https://github.com/llvm/llvm-project/commit/68b890831615fc4350a47cf7ec404156128d03ac
  Author: Shivam Gupta <shivam98.tkg at gmail.com>
  Date:   2023-01-23 (Mon, 23 Jan 2023)

  Changed paths:
    M clang/include/clang/APINotes/Types.h

  Log Message:
  -----------
  [Clang[NFC] Fix bitmask for NullabilityPayload in Types.h

Found by PVS-Studio - https://pvs-studio.com/en/blog/posts/cpp/1003/, N37.

The code you is using the bit mask NullabilityKindMask which is 0x3
(00000011 in binary) to clear the bits in the NullabilityPayload variable.
Since NullabilityPayload is a 64-bit variable and NullabilityKindMask is
only a 8-bit variable(0x3), it will only affect the last 8 bits of the
variable. The higher 56 bits will remain unchanged.

Differential Revision: https://reviews.llvm.org/D142334




More information about the All-commits mailing list