From 53fa82867421a0f99b4cdcabe516070571d3c8e6 Mon Sep 17 00:00:00 2001 From: Mick Jordan <mick.jordan@oracle.com> Date: Thu, 6 Nov 2014 09:57:02 -0800 Subject: [PATCH] preserve visibility state across on.exit handlers --- .../truffle/r/nodes/function/FunctionDefinitionNode.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java index cb3adaf4e8..5e51f4a7de 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java @@ -95,6 +95,8 @@ public final class FunctionDefinitionNode extends RRootNode { return ex.getResult(); } finally { if (onExitProfile.profile(onExitSlot != null && onExitSlot.hasValue(vf))) { + // Must preserve the visibility state as it may be changed by the on.exit expression + boolean isVisible = RContext.isVisible(); ArrayList<Object> current = getCurrentOnExitList(vf, onExitSlot.executeFrameSlot(vf)); for (Object expr : current) { if (!(expr instanceof RNode)) { @@ -103,6 +105,7 @@ public final class FunctionDefinitionNode extends RRootNode { RNode node = (RNode) expr; onExitExpressionCache.execute(vf, node); } + RContext.setVisible(isVisible); } } } -- GitLab