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

Chris Hamilton via All-commits all-commits at lists.llvm.org
Tue Sep 29 07:15:37 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d9ee935679e7164d1c47e351bbbcf5c25742b59c
      https://github.com/llvm/llvm-project/commit/d9ee935679e7164d1c47e351bbbcf5c25742b59c
  Author: Chris Hamilton <Chris.Hamilton at ericsson.com>
  Date:   2020-09-29 (Tue, 29 Sep 2020)

  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-cxx1y.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: ebevhan

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




More information about the All-commits mailing list