EvaluateInternal: capture ValuePrinting request early:

`RunFunction()` might trigger unloading of `lastT`, so store its setting
for "want value printing" in a local variable before calling RunFunction().

Fixes valgrind complaining about `./stressInterpreter` which is reloading
the "outer" stressInterpreter.cxx from inside `RunFunction()`.
This commit is contained in:
Axel Naumann 2021-11-11 12:49:44 +01:00 committed by jenkins
parent 3afd3b4056
commit a860c891d4

View File

@ -1409,11 +1409,11 @@ namespace cling {
!lastT->getWrapperFD()) // no wrapper to run
return Interpreter::kSuccess;
else {
bool WantValuePrinting = lastT->getCompilationOpts().ValuePrinting
!= CompilationOptions::VPDisabled;
ExecutionResult res = RunFunction(lastT->getWrapperFD(), V);
if (res < kExeFirstError) {
if (lastT->getCompilationOpts().ValuePrinting
!= CompilationOptions::VPDisabled
&& V->isValid()
if (WantValuePrinting && V->isValid()
// the !V->needsManagedAllocation() case is handled by
// dumpIfNoStorage.
&& V->needsManagedAllocation())