From e9e986a70cb022a8197675934756562a20ce7fa4 Mon Sep 17 00:00:00 2001
From: Florian Angerer <florian.angerer@oracle.com>
Date: Wed, 13 Dec 2017 14:04:20 +0100
Subject: [PATCH] Materializing abstract string vector for dimnames.

---
 .../r/nodes/access/vector/CachedExtractVectorNode.java        | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedExtractVectorNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedExtractVectorNode.java
index 5101c995fa..7e61a7cf34 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedExtractVectorNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedExtractVectorNode.java
@@ -289,7 +289,9 @@ final class CachedExtractVectorNode extends CachedVectorNode {
                         if (boxNewDimName == null) {
                             boxNewDimName = insert(BoxPrimitiveNode.create());
                         }
-                        result = boxNewDimName.execute(extract(i, (RAbstractStringVector) boxOldDimNames.execute(dataAt), positions[i], positionProfile[i]));
+                        RAbstractStringVector originalDimName = (RAbstractStringVector) boxOldDimNames.execute(dataAt);
+                        RAbstractStringVector newDimName = (RAbstractStringVector) boxNewDimName.execute(extract(i, originalDimName, positions[i], positionProfile[i]));
+                        result = newDimName.materialize();
                     }
                     newDimNames[dimIndex] = result;
                     if (newDimNamesNames != null) {
-- 
GitLab