From 175f558ce06f3b78cdc9e4e6370b16ca703b4c25 Mon Sep 17 00:00:00 2001 From: Siu Kwan Lam Date: Tue, 19 Feb 2013 10:54:31 -0600 Subject: [PATCH] Add error checking for common mistake in Builder.call --- llvm/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/core.py b/llvm/core.py index fa9dc77..fafaa22 100644 --- a/llvm/core.py +++ b/llvm/core.py @@ -2192,6 +2192,10 @@ class Builder(object): if t != v.type: raise TypeError(err_template % (t, v.type)) arg_ptrs = unpack_values(args) + + if (isinstance(fn, Function) and \ + fn.module is not self.basic_block.function.module): + raise ValueError("Intermodule function call") return _make_value( _core.LLVMBuildCall(self.ptr, fn.ptr, arg_ptrs, name))