Skip to content

Commit 31da427

Browse files
committed
fix guards of PyCFuncPtr.__new__
1 parent 3d37592 commit 31da427

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/ctypes/PyCFuncPtrBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static Object simple(Object type, @SuppressWarnings("unused") Object[] args, @Su
184184
return pyCDataNewNode.execute(inliningTarget, type, dict);
185185
}
186186

187-
@Specialization(guards = {"args.length <= 1", "isTuple(args)"})
187+
@Specialization(guards = {"args.length == 1", "isTuple(args)"})
188188
static Object fromNativeLibrary(VirtualFrame frame, Object type, Object[] args, @SuppressWarnings("unused") PKeyword[] kwds,
189189
@Cached PyCFuncPtrFromDllNode pyCFuncPtrFromDllNode) {
190190
return pyCFuncPtrFromDllNode.execute(frame, type, args);
@@ -234,7 +234,7 @@ static Object callback(VirtualFrame frame, Object type, Object[] args, @Suppress
234234
return self;
235235
}
236236

237-
@Specialization(guards = {"args.length != 1", "!isPTuple(args)", "isLong(this, args, longCheckNode)"}, limit = "1")
237+
@Specialization(guards = {"args.length > 1", "!isPTuple(args)", "isLong(this, args, longCheckNode)"}, limit = "1")
238238
static Object error(@SuppressWarnings("unused") Object type, @SuppressWarnings("unused") Object[] args, @SuppressWarnings("unused") PKeyword[] kwds,
239239
@SuppressWarnings("unused") @Bind("this") Node inliningTarget,
240240
@SuppressWarnings("unused") @Exclusive @Cached PyLongCheckNode longCheckNode,

0 commit comments

Comments
 (0)