X86: Avoid accessing SDValues after they've been RAUW'd
authorJustin Bogner <mail@justinbogner.com>
Tue, 12 Apr 2016 21:34:24 +0000 (21:34 +0000)
committerJustin Bogner <mail@justinbogner.com>
Tue, 12 Apr 2016 21:34:24 +0000 (21:34 +0000)
commit32ad24d4efae1484a73e91257f8fe3d1c8bcf7be
treec833d7a95790e485208d48491625c13abf2db7a6
parentd09ae3bfc5a49a384f283544d43f542aac0ba7b5
X86: Avoid accessing SDValues after they've been RAUW'd

This fixes two use-after-frees in selectLEA64_32Addr. If matchAddress
matches an ADD with an AND as an operand, and that AND hits one of the
"heroic transforms" that folds masks and shifts, we end up with N
pointing to an SDNode that was deleted. Make sure we're done accessing
it before that.

Found by ASan with the recycling allocator changes in llvm.org/PR26808.

llvm-svn: 266130
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp