diff --git a/builder.py b/builder.py index 2826e1d..4a6f23b 100644 --- a/builder.py +++ b/builder.py @@ -1057,6 +1057,11 @@ class IntegerValue(OperatorMixin): return self._temp(self.parent.builder.sext(self.value, ty)) else: return self._temp(self.parent.builder.trunc(self.value, ty)) + elif _is_pointer(ty) and _is_int(self.type): + return self._temp(self.parent.builder.inttoptr(self.value, ty)) + elif _is_int(ty) and _is_pointer(self.type): + return self._temp(self.parent.builder.ptrtoint(self.value, ty)) + raise CastError(self.type, ty) class RealValue(OperatorMixin): diff --git a/shortnames.py b/shortnames.py index 06221aa..2acd69d 100644 --- a/shortnames.py +++ b/shortnames.py @@ -14,6 +14,7 @@ float = Type.float() double = Type.double() npy_intp = minitypes.npy_intp.to_llvm(numba.decorators.context) +py_ssize_t = minitypes.Py_ssize_t.to_llvm(numba.decorators.context) # pointers