@@ -859,6 +859,8 @@ object evaluator extends EvaluationRules {
859859 evals2(s, eArgs, Nil , _ => pve, v)((s1, tArgs, eArgsNew, v1) => {
860860// bookkeeper.functionApplications += 1
861861 val joinFunctionArgs = tArgs // ++ c2a.quantifiedVariables.filterNot(tArgs.contains)
862+ val (debugHeapName, debugLabel) = v1.getDebugOldLabel(s1, fapp.pos)
863+ val s1a = if (Verifier .config.enableDebugging()) s1.copy(oldHeaps = s1.oldHeaps + (debugHeapName -> s1.h)) else s1
862864 /* TODO: Does it matter that the above filterNot does not filter out quantified
863865 * variables that are not "raw" function arguments, but instead are used
864866 * in an expression that is used as a function argument?
@@ -869,7 +871,7 @@ object evaluator extends EvaluationRules {
869871 * Hence, the joinedFApp will take two arguments, namely, i*i and i,
870872 * although the latter is not necessary.
871873 */
872- joiner.join[(Term , Option [ast.Exp ]), (Term , Option [ast.Exp ])](s1 , v1)((s2, v2, QB ) => {
874+ joiner.join[(Term , Option [ast.Exp ]), (Term , Option [ast.Exp ])](s1a , v1)((s2, v2, QB ) => {
873875 val pres = func.pres.map(_.transform {
874876 /* [Malte 2018-08-20] Two examples of the test suite, one of which is the regression
875877 * for Carbon issue #210, fail if the subsequent code that strips out triggers from
@@ -955,7 +957,11 @@ object evaluator extends EvaluationRules {
955957 moreJoins = s2.moreJoins,
956958 assertReadAccessOnly = s2.assertReadAccessOnly)
957959 val funcAppNew = eArgsNew.map(args => ast.FuncApp (funcName, args)(fapp.pos, fapp.info, fapp.typ, fapp.errT))
958- QB (s5, (tFApp, funcAppNew), v3)})
960+ val funcAppNewOld = Option .when(withExp)({
961+ if (s5.isEvalInOld || pres.forall(_.isPure)) funcAppNew.get
962+ else ast.DebugLabelledOld (funcAppNew.get, debugLabel)(fapp.pos, fapp.info, fapp.errT)
963+ })
964+ QB (s5, (tFApp, funcAppNewOld), v3)})
959965 /* TODO: The join-function is heap-independent, and it is not obvious how a
960966 * joined snapshot could be defined and represented
961967 */
0 commit comments