[GlobalsAA] An indirect global that is initialized is not fair game
authorJames Molloy <james.molloy@arm.com>
Wed, 28 Oct 2015 10:41:29 +0000 (10:41 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 28 Oct 2015 10:41:29 +0000 (10:41 +0000)
commitd56ad58fbca4a196751a75518eab97cd0aef7d3f
tree1285acacfb649444ae12ea285097f1442783325c
parent7c69e3c7857db6def02a5139f039d0499855f0a9
[GlobalsAA] An indirect global that is initialized is not fair game

When checking if an indirect global (a global with pointer type) is only assigned by allocation functions, first check if the global is itself initialized. If it is, it's not only assigned by allocation functions.

This fixes PR25309. Thanks to David Majnemer for reducing the test case!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251508 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/GlobalsModRef.h
lib/Analysis/GlobalsModRef.cpp
test/Analysis/GlobalsModRef/pr25309.ll [new file with mode: 0644]