From 4dd7449f6c2940e4a1594288a74315f73ae63c11 Mon Sep 17 00:00:00 2001
From: Mick Jordan <mick.jordan@oracle.com>
Date: Wed, 11 May 2016 12:09:00 -0700
Subject: [PATCH] Fix RCallNode.createCloneReplacingArgs creating nested
 ForcePromiseNode

---
 .gitignore                                     | 18 ++++++++++++++----
 .../truffle/r/nodes/function/RCallNode.java    |  6 +++---
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore
index 481569adab..8a7587ac01 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,8 +64,6 @@
 .hprof.txt
 /compilations-*.cfg
 /graal/.*/build.xml
-/.*/build.xml
-/.*/nbproject/
 dist
 foo1
 /doc/.*/dot_temp_
@@ -74,7 +72,8 @@ foo1
 output.txt
 output.cfg
 .cfg
-/nbproject/private/
+**/nbproject/**
+**/build.xml
 /scratch/
 /test/
 /test_gnur/
@@ -112,4 +111,15 @@ R.tokens
 findbugs.html
 test_gnur
 test_fastr
-lib.install.cran*
\ No newline at end of file
+lib.install.cran*
+/com.oracle.truffle.r.nodes.test/nbproject/private/
+/com.oracle.truffle.r.runtime.ffi/nbproject/private/
+/com.oracle.truffle.r.test.cran/nbproject/private/
+/com.oracle.truffle.r.nodes/nbproject/private/
+/com.oracle.truffle.r.runtime/nbproject/private/
+/com.oracle.truffle.r.library/nbproject/private/
+/com.oracle.truffle.r.parser/nbproject/private/
+/com.oracle.truffle.r.parser.processor/nbproject/private/
+/com.oracle.truffle.r.nodes.builtin/nbproject/private/
+/com.oracle.truffle.r.engine/nbproject/private/
+/com.oracle.truffle.r.test/nbproject/private/
\ No newline at end of file
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java
index a779d4b7d2..e13aa94a77 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java
@@ -689,8 +689,8 @@ public abstract class RCallNode extends RNode implements RSyntaxNode, RSyntaxCal
 
     /**
      * Creates a modified call in which the first N arguments are replaced by
-     * {@code replacementArgs}. This is, for example, to support
-     * {@code HiddenInternalFunctions.MakeLazy}, and condition handling.
+     * {@code replacementArgs}. This is only used to support
+     * {@code HiddenInternalFunctions.MakeLazy}.
      */
     @TruffleBoundary
     public static RCallNode createCloneReplacingArgs(RCallNode call, RSyntaxNode... replacementArgs) {
@@ -698,7 +698,7 @@ public abstract class RCallNode extends RNode implements RSyntaxNode, RSyntaxCal
         for (int i = 0; i < args.length; i++) {
             args[i] = i < replacementArgs.length ? replacementArgs[i] : call.arguments[i];
         }
-        return RCallNodeGen.create(call.getSourceSection(), args, call.signature, new ForcePromiseNode(RASTUtils.cloneNode(call.getFunction())));
+        return RCallNodeGen.create(call.getSourceSection(), args, call.signature, RASTUtils.cloneNode(call.getFunction()));
     }
 
     /**
-- 
GitLab