Skip to content

Commit ecdbe1a

Browse files
committed
Fix: missing DescriptorDeleteMarker conversions.
1 parent d788bac commit ecdbe1a

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/CExtNodes.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ protected static PythonClassNativeWrapper wrapNativeClass(PythonManagedClass obj
494494

495495
static boolean isFallback(Object object, PythonObjectLibrary lib) {
496496
return !(object instanceof String || object instanceof Boolean || object instanceof Integer || object instanceof Long || object instanceof Double ||
497-
object instanceof PythonNativeNull || object instanceof PythonAbstractObject) &&
497+
object instanceof PythonNativeNull || object == DescriptorDeleteMarker.INSTANCE || object instanceof PythonAbstractObject) &&
498498
!(lib.isForeignObject(object) && !CApiGuards.isNativeWrapper(object));
499499
}
500500

@@ -656,6 +656,12 @@ static Object doNativeNull(CExtContext cextContext, PythonNativeNull object) {
656656
return ToSulongNode.doNativeNull(cextContext, object);
657657
}
658658

659+
@Specialization
660+
static Object doDeleteMarker(CExtContext cextContext, DescriptorDeleteMarker marker,
661+
@Cached GetNativeNullNode getNativeNullNode) {
662+
return ToSulongNode.doDeleteMarker(cextContext, marker, getNativeNullNode);
663+
}
664+
659665
@Specialization(guards = {"object == cachedObject", "isSpecialSingleton(cachedObject)"})
660666
static Object doSingletonCached(CExtContext cextContext, @SuppressWarnings("unused") PythonAbstractObject object,
661667
@Cached("object") PythonAbstractObject cachedObject,
@@ -827,6 +833,12 @@ static Object doNativeNull(CExtContext cextContext, PythonNativeNull object) {
827833
return ToSulongNode.doNativeNull(cextContext, object);
828834
}
829835

836+
@Specialization
837+
static Object doDeleteMarker(CExtContext cextContext, DescriptorDeleteMarker marker,
838+
@Cached GetNativeNullNode getNativeNullNode) {
839+
return ToSulongNode.doDeleteMarker(cextContext, marker, getNativeNullNode);
840+
}
841+
830842
@Specialization(guards = {"object == cachedObject", "isSpecialSingleton(cachedObject)"})
831843
static Object doSingletonCached(CExtContext cextContext, @SuppressWarnings("unused") PythonAbstractObject object,
832844
@Cached("object") PythonAbstractObject cachedObject,
@@ -1003,6 +1015,9 @@ protected static boolean isFallback(Object obj, GetLazyClassNode getClassNode, I
10031015
if (CApiGuards.isNativeNull(obj)) {
10041016
return false;
10051017
}
1018+
if (obj == DescriptorDeleteMarker.INSTANCE) {
1019+
return false;
1020+
}
10061021
if (PGuards.isAnyPythonObject(obj)) {
10071022
return false;
10081023
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/getsetdescriptor/DescriptorDeleteMarker.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
*/
4141
package com.oracle.graal.python.builtins.objects.getsetdescriptor;
4242

43-
public class DescriptorDeleteMarker {
43+
import com.oracle.truffle.api.interop.TruffleObject;
44+
45+
public class DescriptorDeleteMarker implements TruffleObject {
4446
public static final DescriptorDeleteMarker INSTANCE = new DescriptorDeleteMarker();
4547

4648
private DescriptorDeleteMarker() {

0 commit comments

Comments
 (0)