OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace commits / 19a3768

Fix incorrect usage of scratch spaces
19a37687ab5034831d6947319d4c58bce2b73f1e
by Linas Vepštas <linasvepstas@gmail.com> · 2026-01-23T02:31:08.000Z

Changed files (1) +6 -3

opencog/atoms/execution/EvaluatableLink.cc +6 -3
……@@ -145,7 +145,7 @@ static ValuePtr exec_or_eval(AtomSpace* as,
145145
146146 // Nothing to do, here.
147147 if (VALUE_SHIM_LINK == term->get_type())
148 return term->execute();
148 return term->execute(scratch);
149149
150150 // Argh. The ValueShimLink might be buried deeper in the expression.
151151 // In this case, ValueShimLink::setAtomSpace() will throw a
……@@ -159,13 +159,13 @@ static ValuePtr exec_or_eval(AtomSpace* as,
159159 }
160160 catch (const RuntimeException& ex)
161161 {
162 return term->execute();
162 return term->execute(scratch);
163163 }
164164
165165 if (not sterm->is_executable())
166166 return sterm;
167167
168 ValuePtr vp(sterm->execute(as, silent));
168 ValuePtr vp(sterm->execute(scratch, silent));
169169
170170 // If the return value is a ContainerValue, we assume that this
171171 // is the result of executing a MeetLink or QueryLink.
……@@ -177,6 +177,9 @@ static ValuePtr exec_or_eval(AtomSpace* as,
177177 if (1 == hs.size())
178178 vp = hs[0];
179179 }
180
181 // XXX FIXME? should we be doing the add here? Isn't this the
182 // callers reponsibility?
180183 // if (vp->is_atom()) scratch->add_atom(HandleCast(vp));
181184 if (vp->is_atom()) as->add_atom(HandleCast(vp));
182185 return vp;