Skip to content

Commit 4b106fe

Browse files
committed
Fix list conversion for subclasses
1 parent da065ca commit 4b106fe

File tree

1 file changed

+2
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/builtins

1 file changed

+2
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/builtins/ListNodes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ static PList none(Object cls, @SuppressWarnings("unused") PNone none,
114114
return factory.createList(cls);
115115
}
116116

117-
@Specialization
117+
@Specialization(guards = "cannotBeOverridden(list, getClassNode)", limit = "1")
118118
// Don't use PSequence, that might copy storages that we don't allow for lists
119119
static PList fromList(Object cls, PList list,
120+
@SuppressWarnings("unused") @Cached GetClassNode getClassNode,
120121
@Shared("factory") @Cached PythonObjectFactory factory,
121122
@Cached SequenceNodes.GetSequenceStorageNode getSequenceStorageNode,
122123
@Cached SequenceStorageNodes.CopyNode copyNode) {

0 commit comments

Comments
 (0)