Fix a bug in the code which custom-lowers truncating stores in LegalizeDAG.

Check that the SDValue TargetLowering::LowerOperation returns is not null
before replacing the original node with the returned node.

llvm-svn: 157873
This commit is contained in:
Akira Hatanaka 2012-06-02 01:10:34 +00:00
parent 58268c23ac
commit 6f3b2a670f
1 changed files with 3 additions and 2 deletions

View File

@ -1312,8 +1312,9 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) {
} }
break; break;
case TargetLowering::Custom: case TargetLowering::Custom:
ReplaceNode(SDValue(Node, 0), Tmp1 = TLI.LowerOperation(SDValue(Node, 0), DAG);
TLI.LowerOperation(SDValue(Node, 0), DAG)); if (Tmp1.getNode())
ReplaceNode(SDValue(Node, 0), Tmp1);
break; break;
case TargetLowering::Expand: case TargetLowering::Expand:
assert(!StVT.isVector() && assert(!StVT.isVector() &&