[PATCH] D67986: [InstCombine] snprintf (d, size, "%s", s) -> memccpy (d, s, '\0', size - 1), d[size - 1] = 0
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 2 15:36:03 PDT 2019
- Previous message: [PATCH] D67986: [InstCombine] snprintf (d, size, "%s", s) -> memccpy (d, s, '\0', size - 1), d[size - 1] = 0
- Next message: [PATCH] D67986: [InstCombine] snprintf (d, size, "%s", s) -> memccpy (d, s, '\0', size - 1), d[size - 1] = 0
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
efriedma added a comment.
You could do something like `if (!memccpy (d, s, '\0', size - 1)) d[size - 1] = 0;`, I guess. That's a few more instructions that I'd really like, but I don't see a better alternative.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67986/new/
https://reviews.llvm.org/D67986
- Previous message: [PATCH] D67986: [InstCombine] snprintf (d, size, "%s", s) -> memccpy (d, s, '\0', size - 1), d[size - 1] = 0
- Next message: [PATCH] D67986: [InstCombine] snprintf (d, size, "%s", s) -> memccpy (d, s, '\0', size - 1), d[size - 1] = 0
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the llvm-commits
mailing list