From 742d920aa1f9ba00df8c4780263e5989e8a9d828 Mon Sep 17 00:00:00 2001 From: Weaselbot Date: Sun, 21 Jun 2026 12:55:47 -0400 Subject: [PATCH] Set restype=None for void-returning C functions in conflict_set.py ConflictSet_check, ConflictSet_addWrites, ConflictSet_setOldestVersion, and ConflictSet_destroy return void in C, but the Python wrapper left their ctypes restype at the default c_int. Set restype = None for each to match the C API contract and avoid undefined behavior from reading the return register of void functions. --- conflict_set.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conflict_set.py b/conflict_set.py index 5516087..f645343 100644 --- a/conflict_set.py +++ b/conflict_set.py @@ -88,6 +88,7 @@ class ConflictSet: ctypes.POINTER(ctypes.c_int), ctypes.c_int, ) + self._lib.ConflictSet_check.restype = None self._lib.ConflictSet_addWrites.argtypes = ( ctypes.c_void_p, @@ -95,13 +96,16 @@ class ConflictSet: ctypes.c_int, ctypes.c_int64, ) + self._lib.ConflictSet_addWrites.restype = None self._lib.ConflictSet_setOldestVersion.argtypes = ( ctypes.c_void_p, ctypes.c_int64, ) + self._lib.ConflictSet_setOldestVersion.restype = None self._lib.ConflictSet_destroy.argtypes = (ctypes.c_void_p,) + self._lib.ConflictSet_destroy.restype = None self._lib.ConflictSet_getBytes.argtypes = (ctypes.c_void_p,) self._lib.ConflictSet_getBytes.restype = ctypes.c_int64