aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/iCall.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/iCall.cpp')
-rw-r--r--lib/VMCore/iCall.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/VMCore/iCall.cpp b/lib/VMCore/iCall.cpp
index 9ff6bb6fc8..7632798c66 100644
--- a/lib/VMCore/iCall.cpp
+++ b/lib/VMCore/iCall.cpp
@@ -14,7 +14,7 @@ CallInst::CallInst(Method *m, vector<Value*> &params,
const MethodType* MT = M->getMethodType();
const MethodType::ParamTypes &PL = MT->getParamTypes();
- assert(params.size() == PL.size());
+ assert(params.size() == PL.size() && "Calling a function with bad signature");
#ifndef NDEBUG
MethodType::ParamTypes::const_iterator It = PL.begin();
#endif
@@ -38,8 +38,7 @@ void CallInst::dropAllReferences() {
bool CallInst::setOperand(unsigned i, Value *Val) {
if (i > Params.size()) return false;
if (i == 0) {
- assert(Val->getValueType() == Value::MethodVal);
- M = (Method*)Val;
+ M = Val->castMethodAsserting();
} else {
// TODO: assert = method arg type
Params[i-1] = Val;