Skip to content

Commit bbe2e97

Browse files
committed
[Clang][CodeGen] Fix test failures.
1 parent 0f6ff60 commit bbe2e97

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4990,7 +4990,7 @@ LValue CodeGenFunction::EmitLValueForField(LValue base, const FieldDecl *field,
49904990
(!getDebugInfo() || !rec->hasAttr<BPFPreserveAccessIndexAttr>())) {
49914991
if (Idx != 0) {
49924992
// For structs, we GEP to the field that the record layout suggests.
4993-
if (getLangOpts().PointerOverflowDefined)
4993+
if (!IsInBounds)
49944994
Addr = Builder.CreateConstGEP2_32(Addr, 0, Idx, field->getName());
49954995
else
49964996
Addr = Builder.CreateStructGEP(Addr, Idx, field->getName());

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4460,7 +4460,7 @@ class CodeGenFunction : public CodeGenTypeCache {
44604460
llvm::Value *EmitIvarOffsetAsPointerDiff(const ObjCInterfaceDecl *Interface,
44614461
const ObjCIvarDecl *Ivar);
44624462
LValue EmitLValueForField(LValue Base, const FieldDecl *Field,
4463-
bool IsInBounds = false);
4463+
bool IsInBounds = true);
44644464
LValue EmitLValueForLambdaField(const FieldDecl *Field);
44654465
LValue EmitLValueForLambdaField(const FieldDecl *Field,
44664466
llvm::Value *ThisValue);

0 commit comments

Comments
 (0)