[all-commits] [llvm/llvm-project] e42a34: [Sema] Address-space sensitive check for unbounded...

Chris Hamilton via All-commits all-commits at lists.llvm.org
Fri Jun 11 08:36:36 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e42a347b74400b7212ceaaea6d39562a0435df42
      https://github.com/llvm/llvm-project/commit/e42a347b74400b7212ceaaea6d39562a0435df42
  Author: eahcmrh <chris.hamilton at ericsson.com>
  Date:   2021-06-11 (Fri, 11 Jun 2021)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/Sema/const-eval.c
    A clang/test/Sema/unbounded-array-bounds.c
    M clang/test/SemaCXX/constant-expression-cxx14.cpp

  Log Message:
  -----------
  [Sema] Address-space sensitive check for unbounded arrays (v2)

Check applied to unbounded (incomplete) arrays and pointers to spot
cases where the computed address is beyond the largest possible
addressable extent of the array, based on the address space in which the
array is delcared, or which the pointer refers to.

Check helps to avoid cases of nonsense pointer math and array indexing
which could lead to linker failures or runtime exceptions.  Of
particular interest when building for embedded systems with small
address spaces.

This is version 2 of this patch -- version 1 had some testing issues
due to a sign error in existing code.  That error is corrected and
lit test for this chagne is extended to verify the fix.

Originally reviewed/accepted by: aaron.ballman
Original revision: https://reviews.llvm.org/D86796

Reviewed By: aaron.ballman, ebevhan

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




More information about the All-commits mailing list