Fix the node type for "file" nodes in object files (#1593)

This commit is contained in:
Rangi
2025-01-03 11:20:06 -05:00
committed by GitHub
parent d88feee1c0
commit 73ad431b8d
2 changed files with 1 additions and 4 deletions

View File

@@ -44,9 +44,6 @@ struct FileStackNode {
: type(type_), data(data_){};
std::string const &dump(uint32_t curLineNo) const;
// If true, entering this context generates a new unique ID.
bool generatesUniqueID() const { return type == NODE_REPT || type == NODE_MACRO; }
};
#define DEFAULT_MAX_DEPTH 64

View File

@@ -210,7 +210,7 @@ static bool newFileContext(std::string const &filePath, bool updateStateNow) {
std::shared_ptr<MacroArgs> macroArgs = nullptr;
auto fileInfo =
std::make_shared<FileStackNode>(NODE_MACRO, filePath == "-" ? "<stdin>" : filePath);
std::make_shared<FileStackNode>(NODE_FILE, filePath == "-" ? "<stdin>" : filePath);
if (!contextStack.empty()) {
Context &oldContext = contextStack.top();
fileInfo->parent = oldContext.fileInfo;