mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
Fix bug: Assembler/2003-06-17-InvokeDisassemble.llx
"yes, invoke instructions can have just three arguments" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6736 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -302,16 +302,19 @@ bool BytecodeParser::ParseInstruction(const unsigned char *&Buf,
|
|||||||
if (Raw.NumOperands < 3) return true;
|
if (Raw.NumOperands < 3) return true;
|
||||||
|
|
||||||
Normal = cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg2));
|
Normal = cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg2));
|
||||||
Except = cast<BasicBlock>(getValue(Type::LabelTy, args[0]));
|
if (Raw.NumOperands == 3)
|
||||||
|
Except = cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg3));
|
||||||
|
else {
|
||||||
|
Except = cast<BasicBlock>(getValue(Type::LabelTy, args[0]));
|
||||||
|
|
||||||
FunctionType::ParamTypes::const_iterator It = PL.begin();
|
FunctionType::ParamTypes::const_iterator It = PL.begin();
|
||||||
for (unsigned i = 1; i < args.size(); i++) {
|
for (unsigned i = 1; i < args.size(); i++) {
|
||||||
if (It == PL.end()) return true;
|
if (It == PL.end()) return true;
|
||||||
// TODO: Check getValue for null!
|
// TODO: Check getValue for null!
|
||||||
Params.push_back(getValue(*It++, args[i]));
|
Params.push_back(getValue(*It++, args[i]));
|
||||||
|
}
|
||||||
|
if (It != PL.end()) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (It != PL.end()) return true;
|
|
||||||
} else {
|
} else {
|
||||||
if (args.size() < 4) return true;
|
if (args.size() < 4) return true;
|
||||||
|
|
||||||
@ -326,7 +329,8 @@ bool BytecodeParser::ParseInstruction(const unsigned char *&Buf,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete Raw.VarArgs;
|
if (Raw.NumOperands > 3)
|
||||||
|
delete Raw.VarArgs;
|
||||||
Res = new InvokeInst(M, Normal, Except, Params);
|
Res = new InvokeInst(M, Normal, Except, Params);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user