Fix writing to out-of-bounds arrays writing element 0.

This commit is contained in:
Wilson Snyder
2009-10-08 20:42:45 -04:00
parent c42612abac
commit ceb2f6894f
11 changed files with 462 additions and 25 deletions
+8
View File
@@ -574,6 +574,14 @@ void AstNode::relinkOneLink(AstNode*& pointpr, // Ref to pointer that gets set
pointpr = newp;
}
void AstNode::addHereThisAsNext (AstNode* newp) {
// {old}->this->{next} becomes {old}->new->this->{next}
AstNRelinker handle;
this->unlinkFrBackWithNext(&handle);
newp->addNext(this);
handle.relink(newp);
}
void AstNode::swapWith (AstNode* bp) {
AstNRelinker aHandle;
AstNRelinker bHandle;