@@ -1641,14 +1641,14 @@ inline bool GetPtrDerivedPop(InterpState &S, CodePtr OpPC, uint32_t Off) {
16411641
16421642inline bool GetPtrBase (InterpState &S, CodePtr OpPC, uint32_t Off) {
16431643 const Pointer &Ptr = S.Stk .peek <Pointer>();
1644+ if (!CheckNull (S, OpPC, Ptr, CSK_Base))
1645+ return false ;
16441646
16451647 if (!Ptr.isBlockPointer ()) {
16461648 S.Stk .push <Pointer>(Ptr.asIntPointer ().baseCast (S.getASTContext (), Off));
16471649 return true ;
16481650 }
16491651
1650- if (!CheckNull (S, OpPC, Ptr, CSK_Base))
1651- return false ;
16521652 if (!CheckSubobject (S, OpPC, Ptr, CSK_Base))
16531653 return false ;
16541654 const Pointer &Result = Ptr.atField (Off);
@@ -1661,13 +1661,14 @@ inline bool GetPtrBase(InterpState &S, CodePtr OpPC, uint32_t Off) {
16611661inline bool GetPtrBasePop (InterpState &S, CodePtr OpPC, uint32_t Off) {
16621662 const Pointer &Ptr = S.Stk .pop <Pointer>();
16631663
1664+ if (!CheckNull (S, OpPC, Ptr, CSK_Base))
1665+ return false ;
1666+
16641667 if (!Ptr.isBlockPointer ()) {
16651668 S.Stk .push <Pointer>(Ptr.asIntPointer ().baseCast (S.getASTContext (), Off));
16661669 return true ;
16671670 }
16681671
1669- if (!CheckNull (S, OpPC, Ptr, CSK_Base))
1670- return false ;
16711672 if (!CheckSubobject (S, OpPC, Ptr, CSK_Base))
16721673 return false ;
16731674 const Pointer &Result = Ptr.atField (Off);
0 commit comments