From 4216f0a9b0bd08d66ecb50e453d22a5d8c23da6b Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Thu, 25 Mar 2021 11:26:58 +0100 Subject: [PATCH] Init top-level fstack node line number It still gets written to the object file, generating Valgrind warnings about using uninitialized memory. To silence those errors, and make output more reproducible, init the line no to a dummy (0) value. --- src/asm/fstack.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/asm/fstack.c b/src/asm/fstack.c index 61b68cd6..8ddfb78d 100644 --- a/src/asm/fstack.c +++ b/src/asm/fstack.c @@ -539,6 +539,7 @@ void fstk_Init(char const *mainPath, size_t maxRecursionDepth) context->fileInfo = (struct FileStackNode *)fileInfo; /* lineNo and reptIter are unused on the top-level context */ context->fileInfo->parent = NULL; + context->fileInfo->lineNo = 0; // This still gets written to the object file, so init it context->fileInfo->referenced = false; context->fileInfo->type = NODE_FILE; memcpy(fileInfo->name, fileName, len + 1);