aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/variable.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/variable.cxx')
-rw-r--r--libbuild2/variable.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/libbuild2/variable.cxx b/libbuild2/variable.cxx
index 0f2a3de..74fad14 100644
--- a/libbuild2/variable.cxx
+++ b/libbuild2/variable.cxx
@@ -1761,13 +1761,16 @@ namespace build2
auto* r (const_cast<value_data*> (p.first));
if (r != nullptr)
+ {
+ r->extra = 0;
r->version++;
+ }
return pair<value_data*, const variable&> (r, p.second);
}
pair<value&, bool> variable_map::
- insert (const variable& var, bool typed)
+ insert (const variable& var, bool typed, bool reset_extra)
{
assert (!global_ || ctx->phase == run_phase::load);
@@ -1776,6 +1779,9 @@ namespace build2
if (!p.second)
{
+ if (reset_extra)
+ r.extra = 0;
+
// Check if this is the first access after being assigned a type.
//
// Note: we still need atomic in case this is not a global state.