Skip to content

Commit f52bf9a

Browse files
committed
fixed specialization signature in PyBytes_Concat/Join
1 parent 010617d commit f52bf9a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PythonCextBuiltins.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,7 +1631,7 @@ public Object check(VirtualFrame frame, Object obj,
16311631
@GenerateNodeFactory
16321632
public abstract static class PyBytesConcatNode extends PythonBinaryBuiltinNode {
16331633
@Specialization
1634-
public Object concat(VirtualFrame frame, PBytes original, PBytes newPart,
1634+
public Object concat(VirtualFrame frame, PBytes original, Object newPart,
16351635
@Cached AddNode addNode,
16361636
@Cached TransformExceptionToNativeNode transformExceptionToNativeNode,
16371637
@Cached GetNativeNullNode getNativeNullNode) {
@@ -1643,23 +1643,23 @@ public Object concat(VirtualFrame frame, PBytes original, PBytes newPart,
16431643
}
16441644
}
16451645

1646-
@Specialization(guards = {"!isPBytes(obj)", "isBytesSubtype(frame, obj, getClassNode, isSubtypeNode)"})
1647-
public Object concatNative(VirtualFrame frame, @SuppressWarnings("unused") Object obj,
1646+
@Specialization(guards = {"!isPBytes(original)", "isBytesSubtype(frame, original, getClassNode, isSubtypeNode)"})
1647+
public Object concatNative(VirtualFrame frame, @SuppressWarnings("unused") Object original, @SuppressWarnings("unused") Object newPart,
16481648
@SuppressWarnings("unused") @Cached GetClassNode getClassNode,
16491649
@SuppressWarnings("unused") @Cached IsSubtypeNode isSubtypeNode,
16501650
@Cached GetNativeNullNode getNativeNullNode,
16511651
@Cached PRaiseNativeNode raiseNativeNode) {
16521652
return raiseNativeNode.raise(frame, getNativeNullNode.execute(), PythonBuiltinClassType.NotImplementedError, NATIVE_S_SUBTYPES_NOT_IMPLEMENTED, "bytes");
16531653
}
16541654

1655-
@Specialization(guards = {"!isPBytes(obj)", "!isBytesSubtype(frame, obj, getClassNode, isSubtypeNode)"})
1656-
public Object concat(VirtualFrame frame, Object obj,
1655+
@Specialization(guards = {"!isPBytes(original)", "!isBytesSubtype(frame, original, getClassNode, isSubtypeNode)"})
1656+
public Object concat(VirtualFrame frame, Object original, @SuppressWarnings("unused") Object newPart,
16571657
@SuppressWarnings("unused") @Cached GetClassNode getClassNode,
16581658
@SuppressWarnings("unused") @Cached IsSubtypeNode isSubtypeNode,
16591659
@Cached StrNode strNode,
16601660
@Cached GetNativeNullNode getNativeNullNode,
16611661
@Cached PRaiseNativeNode raiseNativeNode) {
1662-
return raiseNativeNode.raise(frame, getNativeNullNode.execute(), SystemError, BAD_ARG_TO_INTERNAL_FUNC_WAS_S_P, strNode.executeWith(frame, obj), obj);
1662+
return raiseNativeNode.raise(frame, getNativeNullNode.execute(), SystemError, BAD_ARG_TO_INTERNAL_FUNC_WAS_S_P, strNode.executeWith(frame, original), original);
16631663
}
16641664

16651665
protected boolean isBytesSubtype(VirtualFrame frame, Object obj, GetClassNode getClassNode, IsSubtypeNode isSubtypeNode) {
@@ -1671,7 +1671,7 @@ protected boolean isBytesSubtype(VirtualFrame frame, Object obj, GetClassNode ge
16711671
@GenerateNodeFactory
16721672
public abstract static class PyBytesJoinNode extends PythonBinaryBuiltinNode {
16731673
@Specialization
1674-
public Object join(VirtualFrame frame, PBytes original, PBytes newPart,
1674+
public Object join(VirtualFrame frame, PBytes original, Object newPart,
16751675
@Cached JoinNode joinNode,
16761676
@Cached TransformExceptionToNativeNode transformExceptionToNativeNode,
16771677
@Cached GetNativeNullNode getNativeNullNode) {
@@ -1683,23 +1683,23 @@ public Object join(VirtualFrame frame, PBytes original, PBytes newPart,
16831683
}
16841684
}
16851685

1686-
@Specialization(guards = {"!isPBytes(obj)", "isBytesSubtype(frame, obj, getClassNode, isSubtypeNode)"})
1687-
public Object joinNative(VirtualFrame frame, @SuppressWarnings("unused") Object obj,
1686+
@Specialization(guards = {"!isPBytes(original)", "isBytesSubtype(frame, original, getClassNode, isSubtypeNode)"})
1687+
public Object joinNative(VirtualFrame frame, @SuppressWarnings("unused") Object original, @SuppressWarnings("unused") Object newPart,
16881688
@SuppressWarnings("unused") @Cached GetClassNode getClassNode,
16891689
@SuppressWarnings("unused") @Cached IsSubtypeNode isSubtypeNode,
16901690
@Cached PRaiseNativeNode raiseNativeNode,
16911691
@Cached GetNativeNullNode getNativeNullNode) {
16921692
return raiseNativeNode.raise(frame, getNativeNullNode.execute(), PythonBuiltinClassType.NotImplementedError, NATIVE_S_SUBTYPES_NOT_IMPLEMENTED, "bytes");
16931693
}
16941694

1695-
@Specialization(guards = {"!isPBytes(obj)", "!isBytesSubtype(frame, obj, getClassNode, isSubtypeNode)"})
1696-
public Object join(VirtualFrame frame, Object obj,
1695+
@Specialization(guards = {"!isPBytes(original)", "!isBytesSubtype(frame, original, getClassNode, isSubtypeNode)"})
1696+
public Object join(VirtualFrame frame, @SuppressWarnings("unused") Object original, @SuppressWarnings("unused") Object newPart,
16971697
@SuppressWarnings("unused") @Cached GetClassNode getClassNode,
16981698
@SuppressWarnings("unused") @Cached IsSubtypeNode isSubtypeNode,
16991699
@Cached StrNode strNode,
17001700
@Cached PRaiseNativeNode raiseNativeNode,
17011701
@Cached GetNativeNullNode getNativeNullNode) {
1702-
return raiseNativeNode.raise(frame, getNativeNullNode.execute(), SystemError, BAD_ARG_TO_INTERNAL_FUNC_WAS_S_P, strNode.executeWith(frame, obj), obj);
1702+
return raiseNativeNode.raise(frame, getNativeNullNode.execute(), SystemError, BAD_ARG_TO_INTERNAL_FUNC_WAS_S_P, strNode.executeWith(frame, original), original);
17031703
}
17041704

17051705
protected boolean isBytesSubtype(VirtualFrame frame, Object obj, GetClassNode getClassNode, IsSubtypeNode isSubtypeNode) {

0 commit comments

Comments
 (0)