[PATCH] D67986: [InstCombine] snprintf (d, size, "%s", s) -> memccpy (d, s, '\0', size).

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 29 15:16:36 PDT 2019


xbolva00 added a comment.

Oh, I think the proposed transformation in that paper is incorrect.

It should rather be:
memccpy(d,s,0, n-1)
d[n-1] = 0

Since "A terminating null character is automatically appended after the content written." (snprintf)


Repository:
  rL LLVM

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

https://reviews.llvm.org/D67986





More information about the llvm-commits mailing list