@@ -1143,30 +1143,12 @@ inline bool CmpHelperEQ<Pointer>(InterpState &S, CodePtr OpPC, CompareFn Fn) {
11431143  }
11441144
11451145  if  (Pointer::hasSameBase (LHS, RHS)) {
1146-     if  (LHS.inUnion () && RHS.inUnion ()) {
1147-       //  If the pointers point into a union, things are a little more
1148-       //  complicated since the offset we save in interp::Pointer can't be used
1149-       //  to compare the pointers directly.
1150-       size_t  A = LHS.computeOffsetForComparison ();
1151-       size_t  B = RHS.computeOffsetForComparison ();
1152-       S.Stk .push <BoolT>(BoolT::from (Fn (Compare (A, B))));
1153-       return  true ;
1154-     }
1155- 
1156-     unsigned  VL = LHS.getByteOffset ();
1157-     unsigned  VR = RHS.getByteOffset ();
1158-     //  In our Pointer class, a pointer to an array and a pointer to the first
1159-     //  element in the same array are NOT equal. They have the same Base value,
1160-     //  but a different Offset. This is a pretty rare case, so we fix this here
1161-     //  by comparing pointers to the first elements.
1162-     if  (!LHS.isZero () && LHS.isArrayRoot ())
1163-       VL = LHS.atIndex (0 ).getByteOffset ();
1164-     if  (!RHS.isZero () && RHS.isArrayRoot ())
1165-       VR = RHS.atIndex (0 ).getByteOffset ();
1166- 
1167-     S.Stk .push <BoolT>(BoolT::from (Fn (Compare (VL, VR))));
1146+     size_t  A = LHS.computeOffsetForComparison ();
1147+     size_t  B = RHS.computeOffsetForComparison ();
1148+     S.Stk .push <BoolT>(BoolT::from (Fn (Compare (A, B))));
11681149    return  true ;
11691150  }
1151+ 
11701152  //  Otherwise we need to do a bunch of extra checks before returning Unordered.
11711153  if  (LHS.isOnePastEnd () && !RHS.isOnePastEnd () && !RHS.isZero () &&
11721154      RHS.getOffset () == 0 ) {
0 commit comments