aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/config/functions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/config/functions.cxx')
-rw-r--r--libbuild2/config/functions.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/libbuild2/config/functions.cxx b/libbuild2/config/functions.cxx
index 398512c..3d35a01 100644
--- a/libbuild2/config/functions.cxx
+++ b/libbuild2/config/functions.cxx
@@ -40,7 +40,10 @@ namespace build2
if (s == nullptr)
fail << "config.save() called out of project" << endf;
- module* mod (s->find_module<module> (module::name));
+ // See save_config() for details.
+ //
+ assert (s->ctx.phase == run_phase::load);
+ module* mod (s->rw ().find_module<module> (module::name));
if (mod == nullptr)
fail << "config.save() called without config module";