[all-commits] [llvm/llvm-project] 1a8aab: [sanitizer] use the right type for sizeof

Wu Yingcong via All-commits all-commits at lists.llvm.org
Thu Apr 27 16:56:35 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1a8aab6de5de1a085e6311aa9dcfb85010acba86
      https://github.com/llvm/llvm-project/commit/1a8aab6de5de1a085e6311aa9dcfb85010acba86
  Author: Wu, Yingcong <yingcong.wu at intel.com>
  Date:   2023-04-27 (Thu, 27 Apr 2023)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
    M compiler-rt/test/sanitizer_common/TestCases/Linux/netent.cpp
    M compiler-rt/test/sanitizer_common/TestCases/Linux/protoent.cpp

  Log Message:
  -----------
  [sanitizer] use the right type for sizeof

`x_aliases` is an array of string, so to calculate its size, it should
be <size-of-array> times <size-of-element>, which should be
`sizeof(char*)` instead of `sizeof(char**)`.

Reviewed By: vitalybuka

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




More information about the All-commits mailing list