mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user