Skip to content

Commit

Permalink
Fix get intrinsic
Browse files Browse the repository at this point in the history
  • Loading branch information
sklam committed Aug 15, 2012
1 parent 3807871 commit 7880cdd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions llvm/extra.cpp
Expand Up @@ -706,7 +706,7 @@ template <typename W, typename UW>
void unwrap_vec(W *values, unsigned n, std::vector<UW *>& out)
{
out.clear();

out.reserve(n);
while (n--) {
UW *p = llvm::unwrap(*values);
assert(p);
Expand Down Expand Up @@ -847,7 +847,7 @@ LLVMValueRef LLVMGetIntrinsic(LLVMModuleRef module, int id,
assert(modulep);

llvm::Function *intfunc = llvm::Intrinsic::getDeclaration(modulep,
llvm::Intrinsic::ID(id), types_vec[0]);
llvm::Intrinsic::ID(id), types_vec);

return wrap(intfunc);
}
Expand Down
4 changes: 2 additions & 2 deletions llvm/wrap.h
Expand Up @@ -1054,7 +1054,7 @@ _w ## func (PyObject *self, PyObject *args) \
{ \
PyObject *obj1, *obj2; \
intype1 arg1; \
intype2 *arg2v; \
intype2 *arg2v = NULL; \
unsigned arg2n; \
int arg3; \
outtype ret; \
Expand All @@ -1064,7 +1064,7 @@ _w ## func (PyObject *self, PyObject *args) \
\
arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \
arg2n = (unsigned) PyList_Size(obj2); \
if (!(arg2v = ( intype2 *)make_array_from_list(obj2, arg2n)))\
if (arg2n && !(arg2v = ( intype2 *)make_array_from_list(obj2, arg2n)))\
return PyErr_NoMemory(); \
\
ret = func (arg1, arg2v, arg2n, arg3); \
Expand Down

0 comments on commit 7880cdd

Please sign in to comment.