Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix a bug in cptr_to_u64 in emulation
  • Loading branch information
ronnuriel authored and certik committed Jul 19, 2023
commit 09cf64a0ac3f4c187ef3fadfd29d8f93e0b8a84d
4 changes: 2 additions & 2 deletions src/runtime/lpython/lpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,10 +773,10 @@ def __repr__(self):
return ctypes_c_void_p()

def cptr_to_u64(cptr):
return ctypes.addressof(cptr)
return u64(ctypes.cast(cptr, ctypes.c_void_p).value)

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))
Expand Down