]> granicus.if.org Git - clang/commit
Sema: prevent assertion on stack return checking
authorSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 15 Feb 2016 01:51:24 +0000 (01:51 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 15 Feb 2016 01:51:24 +0000 (01:51 +0000)
commite99046b20f3965391fc16ff67037745b7d315e45
treef169cdbf039c637919624afb4a7452df305fc63b
parent1c8c47123f17c4ae9a4de07ee453782b9dae8757
Sema: prevent assertion on stack return checking

In the case that the array indexing itself is within a type dependent context,
bail out of the evaluation.  We would previously try to symbolically evaluate
the expression which would then try to evaluate a non-address expression as an
address, triggering an assertion in Asserts builds.

We only need to consider the array subscript expression itself as in the case
that the base itself being type dependent is handled appropriately in EvalAddr.

Resolves PR26599.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260867 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaChecking.cpp
test/SemaCXX/return-stack-addr-2.cpp [new file with mode: 0644]