@@ -1169,8 +1169,7 @@ static bool interp__builtin_is_aligned_up_down(InterpState &S, CodePtr OpPC,
11691169 const InterpFrame *Frame,
11701170 const CallExpr *Call,
11711171 unsigned BuiltinOp) {
1172- PrimType AlignmentT = *S.Ctx .classify (Call->getArg (1 ));
1173- const APSInt &Alignment = popToAPSInt (S.Stk , AlignmentT);
1172+ const APSInt &Alignment = popToAPSInt (S, Call->getArg (1 ));
11741173
11751174 if (Alignment < 0 || !Alignment.isPowerOf2 ()) {
11761175 S.FFDiag (Call, diag::note_constexpr_invalid_alignment) << Alignment;
@@ -1184,8 +1183,7 @@ static bool interp__builtin_is_aligned_up_down(InterpState &S, CodePtr OpPC,
11841183 return false ;
11851184 }
11861185
1187- // The first parameter is either an integer or a pointer (but not a function
1188- // pointer).
1186+ // The first parameter is either an integer or a pointer.
11891187 PrimType FirstArgT = *S.Ctx .classify (Call->getArg (0 ));
11901188
11911189 if (isIntegralType (FirstArgT)) {
@@ -1204,12 +1202,12 @@ static bool interp__builtin_is_aligned_up_down(InterpState &S, CodePtr OpPC,
12041202 }
12051203 return true ;
12061204 }
1207-
12081205 assert (FirstArgT == PT_Ptr);
12091206 const Pointer &Ptr = S.Stk .pop <Pointer>();
1207+ if (!Ptr.isBlockPointer ())
1208+ return false ;
12101209
1211- unsigned PtrOffset = Ptr.getByteOffset ();
1212- PtrOffset = Ptr.getIndex ();
1210+ unsigned PtrOffset = Ptr.getIndex ();
12131211 CharUnits BaseAlignment =
12141212 S.getASTContext ().getDeclAlign (Ptr.getDeclDesc ()->asValueDecl ());
12151213 CharUnits PtrAlign =
0 commit comments