diff --git a/include/llvm/Object/ELFTypes.h b/include/llvm/Object/ELFTypes.h index c1fadf8e210..ec3c8e7bae4 100644 --- a/include/llvm/Object/ELFTypes.h +++ b/include/llvm/Object/ELFTypes.h @@ -676,9 +676,9 @@ public: return *this; } bool operator==(Elf_Note_Iterator_Impl Other) const { - if (!Nhdr) + if (!Nhdr && Other.Err) (void)(bool)(*Other.Err); - if (!Other.Nhdr) + if (!Other.Nhdr && Err) (void)(bool)(*Err); return Nhdr == Other.Nhdr; }