Skip to content

Commit

Permalink
Merge pull request #2186 from certik/emu_fix1
Browse files Browse the repository at this point in the history
Fix a bug in cptr_to_u64 in emulation
  • Loading branch information
certik authored Jul 19, 2023
2 parents 7d147fb + 09cf64a commit ff0985b
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit ff0985b

Please sign in to comment.