mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user