Use automatic allocation for fstack nodes' iters/names

This commit is contained in:
Rangi42
2024-02-24 21:58:34 -05:00
committed by Sylvie
parent 5075ac8887
commit 0e19f6c0ae
3 changed files with 44 additions and 51 deletions

View File

@@ -336,14 +336,14 @@ static void writeFileStackNode(struct FileStackNode const *node, FILE *f)
putlong(node->lineNo, f);
putc(node->type, f);
if (node->type != NODE_REPT) {
putstring(((struct FileStackNamedNode const *)node)->name->c_str(), f);
putstring(((struct FileStackNamedNode const *)node)->name.c_str(), f);
} else {
struct FileStackReptNode const *reptNode = (struct FileStackReptNode const *)node;
putlong(reptNode->iters->size(), f);
putlong(reptNode->iters.size(), f);
// Iters are stored by decreasing depth, so reverse the order for output
for (uint32_t i = reptNode->iters->size(); i--; )
putlong((*reptNode->iters)[i], f);
for (uint32_t i = reptNode->iters.size(); i--; )
putlong(reptNode->iters[i], f);
}
}