diff --git a/src/runtime/lpython/lpython.py b/src/runtime/lpython/lpython.py index 8817b63ae3..e812581bf7 100644 --- a/src/runtime/lpython/lpython.py +++ b/src/runtime/lpython/lpython.py @@ -773,10 +773,10 @@ def __repr__(self): return ctypes_c_void_p() def cptr_to_u64(cptr): - return ctypes.addressof(cptr) + return u64(ctypes.addressof(cptr)) def u64_to_cptr(ivalue): - return ctypes.c_void_p(ivalue) + return ctypes.c_void_p(i64(ivalue)) def sizeof(arg): return ctypes.sizeof(convert_type_to_ctype(arg))