diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp index 2cbbfe5a9987f..4c359b100ab7e 100644 --- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp +++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp @@ -2053,9 +2053,7 @@ static bool interp__builtin_memchr(InterpState &S, CodePtr OpPC, (ID == Builtin::BIstrchr || ID == Builtin::BI__builtin_strchr); PrimType ElemT = - IsRawByte - ? PT_Sint8 - : *S.getContext().classify(Ptr.getFieldDesc()->getElemQualType()); + IsRawByte ? PT_Sint8 : *S.getContext().classify(getElemType(Ptr)); size_t Index = Ptr.getIndex(); size_t Step = 0;