-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Issue Description
In the file leccalc/aggreports.cpp, at lines 1312‑1315, there is a variable shadowing issue that leads to the fileIDs vector remaining empty after the conditional block.
std::vector<int> fileIDs; // Outer declaration
if (outputFlags_[handles[WHEATSHEAF]] == true) {
std::vector<int> fileIDs = GetFileIDs(handles[WHEATSHEAF], PSEPT); // Inner declaration – shadows the outer one
}
// Here 'fileIDs' is still emptyThe code currently declares std::vector<int> fileIDs outside an if block, then inside the block re‑declares a new local variable with the same name (std::vector<int> fileIDs = ...).
This local variable inside the if scope is destroyed when the block ends, leaving the outer fileIDs unchanged (still empty). Later code that depends on fileIDs being populated will therefore fail or behave incorrectly.
Expected behavior
The inner assignment should modify the outer fileIDs variable, not create a new local one.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
On Hold