[all-commits] [llvm/llvm-project] 33e355: Change __lsan::kMaxAllowedMallocSize literal types...

Clemens Wasser via All-commits all-commits at lists.llvm.org
Tue Dec 7 10:38:30 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 33e3554ea33d98f476f5d5a6fb85472d5dccfe18
      https://github.com/llvm/llvm-project/commit/33e3554ea33d98f476f5d5a6fb85472d5dccfe18
  Author: Clemens Wasser <clemens.wasser at gmail.com>
  Date:   2021-12-07 (Tue, 07 Dec 2021)

  Changed paths:
    M compiler-rt/lib/lsan/lsan_allocator.cpp

  Log Message:
  -----------
  Change __lsan::kMaxAllowedMallocSize literal types to unsigned long long

It is required for the [Leak Sanitizer port to Windows](https://reviews.llvm.org/D115103).
The currently used `unsigned long` type is 64 bits wide on UNIX like systems but only 32 bits wide on Windows.
Because of that, the literal `8UL << 30` causes an integer overflow on Windows.
By changing the type of the literals to `unsigned long long`, we have consistent behavior and no overflows on all Platforms.

Reviewed By: vitalybuka

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




More information about the All-commits mailing list