avoid recursion on very deep sequences of static indices.
This commit is contained in:
parent
f56cf4a737
commit
61d99731c8
18
H/rheap.h
18
H/rheap.h
@ -635,19 +635,23 @@ CleanLUIndex(LogUpdIndex *idx, int recurse)
|
|||||||
static void
|
static void
|
||||||
CleanSIndex(StaticIndex *idx, int recurse)
|
CleanSIndex(StaticIndex *idx, int recurse)
|
||||||
{
|
{
|
||||||
idx->ClPred = PtoPredAdjust(idx->ClPred);
|
beginning:
|
||||||
if (idx->SiblingIndex) {
|
if (!(idx->ClFlags & SwitchTableMask)) {
|
||||||
idx->SiblingIndex = SIndexAdjust(idx->SiblingIndex);
|
restore_opcodes(idx->ClCode, NULL);
|
||||||
if (recurse)
|
|
||||||
CleanSIndex(idx->SiblingIndex, TRUE);
|
|
||||||
}
|
}
|
||||||
|
idx->ClPred = PtoPredAdjust(idx->ClPred);
|
||||||
if (idx->ChildIndex) {
|
if (idx->ChildIndex) {
|
||||||
idx->ChildIndex = SIndexAdjust(idx->ChildIndex);
|
idx->ChildIndex = SIndexAdjust(idx->ChildIndex);
|
||||||
if (recurse)
|
if (recurse)
|
||||||
CleanSIndex(idx->ChildIndex, TRUE);
|
CleanSIndex(idx->ChildIndex, TRUE);
|
||||||
}
|
}
|
||||||
if (!(idx->ClFlags & SwitchTableMask)) {
|
if (idx->SiblingIndex) {
|
||||||
restore_opcodes(idx->ClCode, NULL);
|
idx->SiblingIndex = SIndexAdjust(idx->SiblingIndex);
|
||||||
|
/* use loop to avoid recursion with very complex indices */
|
||||||
|
if (recurse) {
|
||||||
|
idx = idx->SiblingIndex;
|
||||||
|
goto beginning;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user