mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-04 06:09:05 +00:00
Fix an off by one error while accessing complex address element of a DIVariable.
This worked untill now because stars are aligned (i.e. num of complex address elments are always 0 or 2+ and when it is 2+ at least two elements are access together) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130225 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9750acc079
commit
7b5bd37241
@ -622,7 +622,9 @@ namespace llvm {
|
||||
unsigned getNumAddrElements() const;
|
||||
|
||||
uint64_t getAddrElement(unsigned Idx) const {
|
||||
return getUInt64Field(Idx+6);
|
||||
if (getVersion() <= llvm::LLVMDebugVersion8)
|
||||
return getUInt64Field(Idx+6);
|
||||
return getUInt64Field(Idx+7);
|
||||
}
|
||||
|
||||
/// isBlockByrefVariable - Return true if the variable was declared as
|
||||
|
@ -656,6 +656,7 @@ DIVariable DIBuilder::createComplexVariable(unsigned Tag, DIDescriptor Scope,
|
||||
Elts.push_back(F);
|
||||
Elts.push_back(ConstantInt::get(Type::getInt32Ty(VMContext), (LineNo | (ArgNo << 24))));
|
||||
Elts.push_back(Ty);
|
||||
Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)));
|
||||
Elts.append(Addr.begin(), Addr.end());
|
||||
|
||||
return DIVariable(MDNode::get(VMContext, Elts));
|
||||
|
Loading…
Reference in New Issue
Block a user