diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-10-10 17:18:50 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2022-10-11 14:21:58 +0200 |
commit | fe71bb0d62f08b8374fdbeda1c68fbfd823b32d5 (patch) | |
tree | 1c0717c0b1a5b3a20663f9067341e06364f0defe | |
parent | c733376ef74d1f686ca3f35d42ae85cb86cf71ab (diff) | |
download | justbuild-fe71bb0d62f08b8374fdbeda1c68fbfd823b32d5.tar.gz |
configure builtin: Fix segfault on evaluation error
-rw-r--r-- | src/buildtool/build_engine/target_map/built_in_rules.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/buildtool/build_engine/target_map/built_in_rules.cpp b/src/buildtool/build_engine/target_map/built_in_rules.cpp index d90f2bd4..1193e312 100644 --- a/src/buildtool/build_engine/target_map/built_in_rules.cpp +++ b/src/buildtool/build_engine/target_map/built_in_rules.cpp @@ -977,11 +977,14 @@ void ConfigureRule( eval_config = eval_config.Evaluate( param_config, {}, [logger](std::string const& msg) { (*logger)( - fmt::format("Failed evaluating eval_config with:\n{}", msg), + fmt::format("Evaluating 'config' failed with error:\n{}", msg), true); }); + if (not eval_config) { + return; + } if (not eval_config->IsMap()) { - (*logger)(fmt::format("eval_config must evaluate to map, but found {}", + (*logger)(fmt::format("'config' must evaluate to map, but found {}", eval_config->ToString()), true); return; |