Fix a nasty dag combiner bug that caused nondeterminstic crashes (MY FAVORITE!):
authorChris Lattner <sabre@nondot.org>
Sat, 27 May 2006 00:43:02 +0000 (00:43 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 27 May 2006 00:43:02 +0000 (00:43 +0000)
commit729c6d1da87ad5b3bf849c4102b255657f67276c
treec7e52c7d158244ffc5433fc9b2ae43a3d10f59db
parent3258ed6a361bf405a89f7af0b1885841d9909516
Fix a nasty dag combiner bug that caused nondeterminstic crashes (MY FAVORITE!):
SimplifySelectOps would eliminate a Select, delete it, then return true.

The clients would see that it did something and return null.

The top level would see a null return, and decide that nothing happened,
proceeding to process the node in other ways: boom.

The fix is simple: clients of SimplifySelectOps should return the select
node itself.

In order to catch really obnoxious boogs like this in the future, add an
assert that nodes are not deleted.  We do this by checking for a sentry node
type that the SDNode dtor sets when a node is destroyed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28514 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp