]> granicus.if.org Git - clang/commit
[analyzer] Accept references to variables declared "extern void" (C only).
authorJordan Rose <jordan_rose@apple.com>
Wed, 29 May 2013 20:50:34 +0000 (20:50 +0000)
committerJordan Rose <jordan_rose@apple.com>
Wed, 29 May 2013 20:50:34 +0000 (20:50 +0000)
commit1acb394679b6e644044a0f6c358229759009b1a6
treee635fe425822d6fa2f9efdcdbaf791db50b1349e
parent42b7861f957591ab40128419dcef0fae081364d6
[analyzer] Accept references to variables declared "extern void" (C only).

In C, 'void' is treated like any other incomplete type, and though it is
never completed, you can cast the address of a void-typed variable to do
something useful. (In C++ it's illegal to declare a variable with void type.)

Previously we asserted on this code; now we just treat it like any other
incomplete type.

And speaking of incomplete types, we don't know their extent. Actually
check that in TypedValueRegion::getExtent, though that's not being used
by any checkers that are on by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182880 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngine.cpp
lib/StaticAnalyzer/Core/MemRegion.cpp
test/Analysis/misc-ps.c
test/Analysis/out-of-bounds.c