OSDN Git Service

[CFLAA] Fix a use-of-invalid-pointer bug.
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Mon, 2 May 2016 18:09:19 +0000 (18:09 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Mon, 2 May 2016 18:09:19 +0000 (18:09 +0000)
commitc3791a9351f91d93dffdfedcfb84f2dc4b1ed261
treeef7e0b0874ec8342726919b746f0fa79adc34419
parent0e6ef97ce04db611f544c2b5e219568180523f7a
[CFLAA] Fix a use-of-invalid-pointer bug.

As shown in the diff, we used to add to CFLAA's cache by doing
`Cache[Fn] = buildSetsFrom(Fn)`. `buildSetsFrom(Fn)` may cause `Cache`
to reallocate its underlying storage, if this happens and `Cache[Fn]`
was evaluated prior to `buildSetsFrom(Fn)`, then we'll store the result
to a bad address.

Patch by Jia Chen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268269 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/CFLAliasAnalysis.cpp