diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-09-02 14:16:44 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-09-02 14:16:44 +0200 |
commit | 94a043ff3b0e9de92bdb62372f9a82186d8e871c (patch) | |
tree | fe41e5fb9df4536bee03a044d0269b2d4c0bd492 | |
parent | 14652da43278f1b1225c0b982d6d81086ad250b7 (diff) |
EvalCache: Fix caching of strings
This was broken in 50f13b06fb1b2f50a97323c000d1094d090f08ea. Once
again it turns out that putting a bool in a std::variant is a bad
idea, since pointers get silently cast to them...
-rw-r--r-- | src/libexpr/eval-cache.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libexpr/eval-cache.cc b/src/libexpr/eval-cache.cc index 46177a0a4..381344b40 100644 --- a/src/libexpr/eval-cache.cc +++ b/src/libexpr/eval-cache.cc @@ -391,7 +391,8 @@ Value & AttrCursor::forceValue() if (root->db && (!cachedValue || std::get_if<placeholder_t>(&cachedValue->second))) { if (v.type == tString) - cachedValue = {root->db->setString(getKey(), v.string.s, v.string.context), v.string.s}; + cachedValue = {root->db->setString(getKey(), v.string.s, v.string.context), + string_t{v.string.s, {}}}; else if (v.type == tPath) cachedValue = {root->db->setString(getKey(), v.path), v.path}; else if (v.type == tBool) |