mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
Merge pull request #13761 from xokdvium/fix-dangling-pointers
libstore: Fix dangling pointers in DerivationGoal constructors
This commit is contained in:
commit
c736db5320
1 changed files with 3 additions and 4 deletions
|
|
@ -34,11 +34,10 @@ DerivationGoal::DerivationGoal(
|
|||
, drvPath(drvPath)
|
||||
, wantedOutput(wantedOutput)
|
||||
, outputHash{[&] {
|
||||
if (auto * mOutputHash = get(staticOutputHashes(worker.evalStore, drv), wantedOutput))
|
||||
auto outputHashes = staticOutputHashes(worker.evalStore, drv);
|
||||
if (auto * mOutputHash = get(outputHashes, wantedOutput))
|
||||
return *mOutputHash;
|
||||
else
|
||||
throw Error(
|
||||
"derivation '%s' does not have output '%s'", worker.store.printStorePath(drvPath), wantedOutput);
|
||||
throw Error("derivation '%s' does not have output '%s'", worker.store.printStorePath(drvPath), wantedOutput);
|
||||
}()}
|
||||
, buildMode(buildMode)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue