================
@@ -6544,6 +6544,14 @@ bool InterpretOffsetOf(InterpState &S, CodePtr OpPC,
const OffsetOfExpr *E,
// When generating bytecode, we put all the index expressions as Sint64
on
// the stack.
int64_t Index = ArrayIndices[ArrayIndex];
+ // Reject negative indices and unsigned indices that wrapped to negative
+ // after the Uint64->Sint64 cast (e.g. __uint128_t >=
0x8000000000000000).
+ if (Index < 0) {
----------------
marlus wrote:
I think it is duplicated. So same as the other above.
https://github.com/llvm/llvm-project/pull/204139
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits