From 43e0c40488222e5eb529e53ca7cbbdeec3e29212 Mon Sep 17 00:00:00 2001
From: Adam Welc <adam.welc@oracle.com>
Date: Wed, 10 Aug 2016 21:40:37 -0700
Subject: [PATCH] Pairlist copy should involve copying attributes the same as
 copy method for all other data structures.

---
 .../src/com/oracle/truffle/r/runtime/data/RPairList.java    | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RPairList.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RPairList.java
index 7a1944f3ea..d2f1b99c45 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RPairList.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/RPairList.java
@@ -273,6 +273,12 @@ public class RPairList extends RSharingAttributeStorage implements RAbstractCont
             result = (RPairList) result.cdr;
             original = origList.cdr;
         }
+        if (getAttributes() != null) {
+            RAttributes newAttributes = result.initAttributes();
+            for (RAttribute attr : getAttributes()) {
+                newAttributes.put(attr.getName(), attr.getValue());
+            }
+        }
         return result;
     }
 
-- 
GitLab