Add error checking for common mistake in Builder.call

This commit is contained in:
Siu Kwan Lam 2013-02-19 10:54:31 -06:00
commit 175f558ce0

View file

@ -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))