]> granicus.if.org Git - clang/commit
Replace Const-Member checking with non-recursive version.
authorErich Keane <erich.keane@intel.com>
Tue, 11 Dec 2018 21:54:52 +0000 (21:54 +0000)
committerErich Keane <erich.keane@intel.com>
Tue, 11 Dec 2018 21:54:52 +0000 (21:54 +0000)
commit43ceab969ac1d244b27f86162b47a9904f6ad053
tree129bc5abf913c4e1329bae0c220034407609f0ab
parente11b388474b7f40545afbeb6b3335f09bff65a6c
Replace Const-Member checking with non-recursive version.

As reported in PR39946, these two implementations cause stack overflows
to occur when a type recursively contains itself.  While this only
happens when an incomplete version of itself is used by membership (and
thus an otherwise invalid program), the crashes might be surprising.

The solution here is to replace the recursive implementation with one
that uses a std::vector as a queue.  Old values are kept around to
prevent re-checking already checked types.

Change-Id: I582bb27147104763d7daefcfee39d91f408b9fa8

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348899 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/Type.cpp
lib/Sema/SemaExpr.cpp
test/Sema/assign.c