From 56796cad617f5106ef773a2e21519720df9bf646 Mon Sep 17 00:00:00 2001 From: Siu Kwan Lam Date: Fri, 14 Sep 2012 18:42:49 -0700 Subject: [PATCH] Follow up on pull request 21. Since PyCapsule_GetPointer returns NULL on error, we should check if the list element is Py_None. --- llvm/core.py | 3 +++ llvm/wrap.cpp | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/llvm/core.py b/llvm/core.py index 52c9d7f..d92f6d4 100644 --- a/llvm/core.py +++ b/llvm/core.py @@ -1456,6 +1456,9 @@ class Function(GlobalValue): class MetaData(Value): @staticmethod def get(module, values): + ''' + values -- must be an iterable of Constant or None. None is treated as "null". + ''' vs = unpack_values_or_none(values) ptr = _core.LLVMMetaDataGet(module.ptr, vs) return MetaData(ptr) diff --git a/llvm/wrap.cpp b/llvm/wrap.cpp index 205acc9..84df081 100644 --- a/llvm/wrap.cpp +++ b/llvm/wrap.cpp @@ -101,7 +101,14 @@ void **make_array_from_list(PyObject *list, int n) int i; for (i=0; i