mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
[CFL-AA] CFL-AA should not assert on an va_arg instruction
The CFL-AA implementation was missing a visit* routine for va_arg instructions, causing it to assert when run on a function that had one. For now, handle these in a conservative way. Fixes PR20954. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219718 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -317,6 +317,17 @@ public:
|
||||
Output.push_back(Edge(Ptr, Val, EdgeType::Dereference, AttrNone));
|
||||
}
|
||||
|
||||
void visitVAArgInst(VAArgInst &Inst) {
|
||||
// We can't fully model va_arg here. For *Ptr = Inst.getOperand(0), it does
|
||||
// two things:
|
||||
// 1. Loads a value from *((T*)*Ptr).
|
||||
// 2. Increments (stores to) *Ptr by some target-specific amount.
|
||||
// For now, we'll handle this like a landingpad instruction (by placing the
|
||||
// result in its own group, and having that group alias externals).
|
||||
auto *Val = &Inst;
|
||||
Output.push_back(Edge(Val, Val, EdgeType::Assign, AttrAll));
|
||||
}
|
||||
|
||||
static bool isFunctionExternal(Function *Fn) {
|
||||
return Fn->isDeclaration() || !Fn->hasLocalLinkage();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user