mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-28 22:55:52 +00:00
Bug fix: X.mergeWith(Y) was not updating Y if Y was a null node handle!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10953 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9a37f2d96a
commit
5254a8dda8
@ -679,13 +679,20 @@ void DSNode::MergeNodes(DSNodeHandle& CurNodeH, DSNodeHandle& NH) {
|
|||||||
// Offset indicates what offset the specified node is to be merged into the
|
// Offset indicates what offset the specified node is to be merged into the
|
||||||
// current node.
|
// current node.
|
||||||
//
|
//
|
||||||
// The specified node may be a null pointer (in which case, nothing happens).
|
// The specified node may be a null pointer (in which case, we update it to
|
||||||
|
// point to this node).
|
||||||
//
|
//
|
||||||
void DSNode::mergeWith(const DSNodeHandle &NH, unsigned Offset) {
|
void DSNode::mergeWith(const DSNodeHandle &NH, unsigned Offset) {
|
||||||
DSNode *N = NH.getNode();
|
DSNode *N = NH.getNode();
|
||||||
if (N == 0 || (N == this && NH.getOffset() == Offset))
|
if (N == this && NH.getOffset() == Offset)
|
||||||
return; // Noop
|
return; // Noop
|
||||||
|
|
||||||
|
// If the RHS is a null node, make it point to this node!
|
||||||
|
if (N == 0) {
|
||||||
|
NH.mergeWith(DSNodeHandle(this, Offset));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
assert(!N->isDeadNode() && !isDeadNode());
|
assert(!N->isDeadNode() && !isDeadNode());
|
||||||
assert(!hasNoReferrers() && "Should not try to fold a useless node!");
|
assert(!hasNoReferrers() && "Should not try to fold a useless node!");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user