[PATCH] D106908: Improve UBSan documentation
Diane Meirowitz via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 3 06:04:59 PDT 2021
DianeMeirowitz added a comment.
Mitch,
OK and thanks for submitting it!
Diane
On 8/2/21, 5:55 PM, "Mitch Phillips via Phabricator" <reviews at reviews.llvm.org> wrote:
hctim added a comment.
In D106908#2910131 <https://urldefense.com/v3/__https://reviews.llvm.org/D106908*2910131__;Iw!!ACWV5N9M2RV99hQ!ezsHkymW9n_oArVw48GURjA0PCnyK2zxkbZU2B9adp3WEpn3KvcVau7Y0fo6bxKxWNDu$ >, @DianeMeirowitz wrote:
> I don't agree with the phrasing : "Array subscript out of bounds, when the bounds can be statically determined". It is long, and I think it may confuse people who don't read language standards and also as far as I know, neither C nor C++ has a true dynamic array type. Dynamic arrays are declared as pointers, not arrays. So I suggest just keeping my original simple phrasing "Array subscript out of bounds". But if you feel strongly about this, go ahead.
Indirection can kill the bounds tracking, so we normally add the caveat that "the bounds can be statically determined". For example, this simple case escapes ubsan-bounds (but not asan):
int f(int y[]) {
return y[1];
}
int main() {
int x[1];
return f(x);
}
I'll submit with the nit.
CHANGES SINCE LAST ACTION
https://urldefense.com/v3/__https://reviews.llvm.org/D106908/new/__;!!ACWV5N9M2RV99hQ!ezsHkymW9n_oArVw48GURjA0PCnyK2zxkbZU2B9adp3WEpn3KvcVau7Y0fo6b0vh3Zht$
https://urldefense.com/v3/__https://reviews.llvm.org/D106908__;!!ACWV5N9M2RV99hQ!ezsHkymW9n_oArVw48GURjA0PCnyK2zxkbZU2B9adp3WEpn3KvcVau7Y0fo6b5X0CPtC$
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106908/new/
https://reviews.llvm.org/D106908
More information about the cfe-commits
mailing list