aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/ByteCode/Pointer.cpp
diff options
context:
space:
mode:
authorTimm Baeder <tbaeder@redhat.com>2024-08-18 08:59:34 +0200
committerGitHub <noreply@github.com>2024-08-18 08:59:34 +0200
commitdac182990dabe8d15cfb8079aba68df2ded015aa (patch)
tree89288cb4f0cf66e25a882bc3960e0385b2ec9cc4 /clang/lib/AST/ByteCode/Pointer.cpp
parent07bd3bb9b7eb34426a81de2b988f53f08611ab35 (diff)
downloadllvm-dac182990dabe8d15cfb8079aba68df2ded015aa.zip
llvm-dac182990dabe8d15cfb8079aba68df2ded015aa.tar.gz
llvm-dac182990dabe8d15cfb8079aba68df2ded015aa.tar.bz2
[clang][bytecode] IntPointer::atOffset() should append (#104686)
... to current offset. This breaks other tests which this commit also fixes. Namely, getIndex() should return the integer representation for non-block pointers.
Diffstat (limited to 'clang/lib/AST/ByteCode/Pointer.cpp')
-rw-r--r--clang/lib/AST/ByteCode/Pointer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/ByteCode/Pointer.cpp b/clang/lib/AST/ByteCode/Pointer.cpp
index e394595..5b9e837 100644
--- a/clang/lib/AST/ByteCode/Pointer.cpp
+++ b/clang/lib/AST/ByteCode/Pointer.cpp
@@ -654,5 +654,5 @@ IntPointer IntPointer::atOffset(const ASTContext &ASTCtx,
uint64_t FieldOffset =
ASTCtx.toCharUnitsFromBits(Layout.getFieldOffset(FieldIndex))
.getQuantity();
- return IntPointer{this->Desc, FieldOffset};
+ return IntPointer{this->Desc, this->Value + FieldOffset};
}