| … | … | @@ -145,7 +145,7 @@ static ValuePtr exec_or_eval(AtomSpace* as, |
| 145 | 145 | |
| 146 | 146 | // Nothing to do, here. |
| 147 | 147 | if (VALUE_SHIM_LINK == term->get_type()) |
| 148 | | return term->execute(); |
| 148 | return term->execute(scratch); |
| 149 | 149 | |
| 150 | 150 | // Argh. The ValueShimLink might be buried deeper in the expression. |
| 151 | 151 | // In this case, ValueShimLink::setAtomSpace() will throw a |
| … | … | @@ -159,13 +159,13 @@ static ValuePtr exec_or_eval(AtomSpace* as, |
| 159 | 159 | } |
| 160 | 160 | catch (const RuntimeException& ex) |
| 161 | 161 | { |
| 162 | | return term->execute(); |
| 162 | return term->execute(scratch); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | if (not sterm->is_executable()) |
| 166 | 166 | return sterm; |
| 167 | 167 | |
| 168 | | ValuePtr vp(sterm->execute(as, silent)); |
| 168 | ValuePtr vp(sterm->execute(scratch, silent)); |
| 169 | 169 | |
| 170 | 170 | // If the return value is a ContainerValue, we assume that this |
| 171 | 171 | // is the result of executing a MeetLink or QueryLink. |
| … | … | @@ -177,6 +177,9 @@ static ValuePtr exec_or_eval(AtomSpace* as, |
| 177 | 177 | if (1 == hs.size()) |
| 178 | 178 | vp = hs[0]; |
| 179 | 179 | } |
| 180 | |
| 181 | // XXX FIXME? should we be doing the add here? Isn't this the |
| 182 | // callers reponsibility? |
| 180 | 183 | // if (vp->is_atom()) scratch->add_atom(HandleCast(vp)); |
| 181 | 184 | if (vp->is_atom()) as->add_atom(HandleCast(vp)); |
| 182 | 185 | return vp; |