4545import com .oracle .truffle .r .nodes .attributes .SpecialAttributesFunctions .GetRowNamesAttributeNode ;
4646import com .oracle .truffle .r .nodes .function .opt .UpdateShareableChildValueNode ;
4747import com .oracle .truffle .r .nodes .unary .CastNode ;
48+ import com .oracle .truffle .r .nodes .unary .InternStringNode ;
4849import com .oracle .truffle .r .runtime .ArgumentsSignature ;
4950import com .oracle .truffle .r .runtime .RError ;
5051import com .oracle .truffle .r .runtime .RError .Message ;
@@ -144,6 +145,7 @@ public abstract static class ATTRIB extends FFIUpCallNode.Arg1 {
144145
145146 @ Specialization
146147 public Object doAttributable (RAttributable obj ,
148+ @ Cached ("create()" ) InternStringNode internStringNode ,
147149 @ Cached ("createWithCompactRowNames()" ) GetAttributesNode getAttributesNode ) {
148150 Object resultObj = getAttributesNode .execute (obj );
149151 if (resultObj == RNull .instance ) {
@@ -153,14 +155,14 @@ public Object doAttributable(RAttributable obj,
153155 RList list = (RList ) resultObj ;
154156 Object result = RNull .instance ;
155157 RStringVector names = list .getNames ();
156- assert names .getLength () == list .getLength ();
158+ assert names != null && names .getLength () == list .getLength ();
157159 for (int i = list .getLength () - 1 ; i >= 0 ; i --) {
158160 Object item = list .getDataAt (i );
159161 String name = names .getDataAt (i );
160162 if (name .equals (RRuntime .ROWNAMES_ATTR_KEY )) {
161163 item = GetRowNamesAttributeNode .ensureRowNamesCompactFormat (item );
162164 }
163- RSymbol symbol = RDataFactory .createSymbol (name );
165+ RSymbol symbol = RDataFactory .createSymbol (internStringNode . execute ( name ) );
164166 result = RDataFactory .createPairList (item , result , symbol );
165167 }
166168 return result ;
0 commit comments