mirror of
https://github.com/NixOS/nix.git
synced 2025-11-12 13:36:02 +01:00
Fix uninitialized field in Attr constructor
The default constructor for Attr was not initializing the value pointer, which could lead to undefined behavior when the uninitialized pointer is accessed. This was caught by clang-tidy's UninitializedObject check. This fixes the warning: 1 uninitialized field at the end of the constructor call [clang-analyzer-optin.cplusplus.UninitializedObject]
This commit is contained in:
parent
6bf940d636
commit
3c0cd73418
1 changed files with 1 additions and 1 deletions
|
|
@ -23,7 +23,7 @@ struct Attr
|
|||
way we keep Attr size at two words with no wasted space. */
|
||||
Symbol name;
|
||||
PosIdx pos;
|
||||
Value * value;
|
||||
Value * value = nullptr;
|
||||
Attr(Symbol name, Value * value, PosIdx pos = noPos)
|
||||
: name(name), pos(pos), value(value) { };
|
||||
Attr() { };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue