mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
Fix assertion failure in nix-env
$ nix-env -f ~/Dev/nixops/ -iA foo nix-env: src/libexpr/eval.hh:57: void nix::Bindings::push_back(const nix::Attr&): Assertion `size_ < capacity' failed. Aborted
This commit is contained in:
parent
a5e2c8e560
commit
c2a8b5c42d
2 changed files with 8 additions and 4 deletions
|
@ -39,10 +39,10 @@ public:
|
|||
typedef uint32_t size_t;
|
||||
|
||||
private:
|
||||
size_t size_, capacity;
|
||||
size_t size_, capacity_;
|
||||
Attr attrs[0];
|
||||
|
||||
Bindings(uint32_t capacity) : size_(0), capacity(capacity) { }
|
||||
Bindings(size_t capacity) : size_(0), capacity_(capacity) { }
|
||||
Bindings(const Bindings & bindings) = delete;
|
||||
|
||||
public:
|
||||
|
@ -54,7 +54,7 @@ public:
|
|||
|
||||
void push_back(const Attr & attr)
|
||||
{
|
||||
assert(size_ < capacity);
|
||||
assert(size_ < capacity_);
|
||||
attrs[size_++] = attr;
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,8 @@ public:
|
|||
|
||||
void sort();
|
||||
|
||||
size_t capacity() { return capacity_; }
|
||||
|
||||
friend class EvalState;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue