aboutsummaryrefslogtreecommitdiff
path: root/bpkg/package-configuration.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/package-configuration.cxx')
-rw-r--r--bpkg/package-configuration.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/bpkg/package-configuration.cxx b/bpkg/package-configuration.cxx
index 6ec2ea3..624de18 100644
--- a/bpkg/package-configuration.cxx
+++ b/bpkg/package-configuration.cxx
@@ -130,10 +130,15 @@ namespace bpkg
if (da.prefer || cfg.empty ())
depc.reload_defaults (cfg);
-
- depc_cfgs.push_back (cfg);
}
+ // Note that we need to collect the dependency configurations as a
+ // separate loop so that the stored references are not invalidated by
+ // operator[] (which is really a push_back() into a vector).
+ //
+ for (package_skeleton& depc: depcs)
+ depc_cfgs.push_back (cfgs[depc.key]);
+
// Step 2: execute the prefer/accept or requires clauses.
//
if (!(da.require