Correct problem that allows indirect function calls

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1179 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2001-11-07 20:12:30 +00:00
parent ea38c0e85c
commit 070cf5e47e

View File

@ -806,7 +806,11 @@ void Interpreter::executeCallInst(CallInst *I, ExecutionContext &SF) {
for (unsigned i = 1; i < I->getNumOperands(); ++i)
ArgVals.push_back(getOperandValue(I->getOperand(i), SF));
callMethod(I->getCalledMethod(), ArgVals);
// To handle indirect calls, we must get the pointer value from the argument
// and treat it as a method pointer.
GenericValue SRC = getOperandValue(I->getCalledValue(), SF);
callMethod((Method*)SRC.PointerVal, ArgVals);
}
static void executePHINode(PHINode *I, ExecutionContext &SF) {