[all-commits] [llvm/llvm-project] 572b08: [clang] Add back -fsanitize=array-bounds workaroun...

Fangrui Song via All-commits all-commits at lists.llvm.org
Fri Jun 24 22:15:59 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 572b08790a69f955ae0cbb1b4a7d4a215f15dad9
      https://github.com/llvm/llvm-project/commit/572b08790a69f955ae0cbb1b4a7d4a215f15dad9
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M clang/lib/CodeGen/CGExpr.cpp
    A clang/test/CodeGen/bounds-checking-fma.c

  Log Message:
  -----------
  [clang] Add back -fsanitize=array-bounds workaround for size-1 array after -fstrict-flex-arrays change

Before C99 introduced flexible array member, common practice uses size-1 array
to emulate FAM, e.g. https://github.com/python/cpython/issues/94250
As a result, -fsanitize=array-bounds instrumentation skipped such structures
as a workaround (from 539e4a77bbabbc19f22b2bd24e04af2e432e599d).

D126864 accidentally dropped the workaround. Add it back with tests.




More information about the All-commits mailing list