-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang][bytecode] Use field descriptor in IntPointer::atOffset #109238
Conversation
We're otherwise still pointing to the old type, but with the new offset.
|
@llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) ChangesWe're otherwise still pointing to the old type, but with the new offset. Full diff: https://github.com/llvm/llvm-project/pull/109238.diff 2 Files Affected:
diff --git a/clang/lib/AST/ByteCode/Pointer.cpp b/clang/lib/AST/ByteCode/Pointer.cpp
index 282953eb991a6b..387cad9b137c02 100644
--- a/clang/lib/AST/ByteCode/Pointer.cpp
+++ b/clang/lib/AST/ByteCode/Pointer.cpp
@@ -665,7 +665,7 @@ IntPointer IntPointer::atOffset(const ASTContext &ASTCtx,
uint64_t FieldOffset =
ASTCtx.toCharUnitsFromBits(Layout.getFieldOffset(FieldIndex))
.getQuantity();
- return IntPointer{this->Desc, this->Value + FieldOffset};
+ return IntPointer{F->Desc, this->Value + FieldOffset};
}
IntPointer IntPointer::baseCast(const ASTContext &ASTCtx,
diff --git a/clang/test/AST/ByteCode/codegen.c b/clang/test/AST/ByteCode/codegen.c
index 8434992823010e..3c6f17e2b87264 100644
--- a/clang/test/AST/ByteCode/codegen.c
+++ b/clang/test/AST/ByteCode/codegen.c
@@ -17,3 +17,10 @@ struct B {
};
const int A = (char *)(&( (struct B *)(16) )->b[0]) - (char *)(16);
// CHECK: @A = constant i32 1
+
+struct X { int a[2]; };
+int test(void) {
+ static int i23 = (int) &(((struct X *)0)->a[1]);
+ return i23;
+}
+// CHECK: @test.i23 = internal global i32 4, align 4
|
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/3389 Here is the relevant piece of the build log for the reference |
…109238) We're otherwise still pointing to the old type, but with the new offset.
We're otherwise still pointing to the old type, but with the new offset.