shafik added a comment.

Thank you for this fix, I have some comments.



================
Comment at: clang/lib/Sema/SemaChecking.cpp:16068
     DiagRuntimeBehavior(BaseExpr->getBeginLoc(), BaseExpr,
                         PDiag(DiagID) << toString(index, 10, true)
-                                      << toString(size, 10, true)
----------------
`index` is also wrong as you can see from the diagnostic below `array index 
32768 is past`.

I think what you want is `index.getNumWords()` and `size.getNumWords()`.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:16070
-                                      << toString(size, 10, true)
+                                      << toString(ArrayTy->getSize(), 10, true)
                                       << (unsigned)size.getLimitedValue(~0U)
                                       << IndexExpr->getSourceRange());
----------------
It is not clear what this is for.

If we look at `warn_array_index_exceeds_bounds` in `DiagnosticSemaKinds.td` we 
can see that `element%s2` which I believe is a typo and means that this 
argument is lost.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135920/new/

https://reviews.llvm.org/D135920

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to