Skip to content

Commit c3329b1

Browse files
committed
[clang][Interp][NFC] Limit Pointer::isArrayElement() to actual arrays
Similar to what we do in isArrayRoot() - only return true here if the Pointee is actually of array type.
1 parent 5b3eb1b commit c3329b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/AST/Interp/Pointer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ class Pointer {
279279
return getFieldDesc()->isUnknownSizeArray();
280280
}
281281
/// Checks if the pointer points to an array.
282-
bool isArrayElement() const { return Base != Offset; }
282+
bool isArrayElement() const { return inArray() && Base != Offset; }
283283
/// Pointer points directly to a block.
284284
bool isRoot() const {
285285
return (Base == 0 || Base == RootPtrMark) && Offset == 0;

0 commit comments

Comments
 (0)