[SimplifyLibCalls] avoid crash on pointer math
authorSanjay Patel <spatel@rotateright.com>
Mon, 26 Jul 2021 14:52:43 +0000 (10:52 -0400)
committerSanjay Patel <spatel@rotateright.com>
Mon, 26 Jul 2021 15:08:45 +0000 (11:08 -0400)
commit87d604ffe494fcf66e469e2758c289f18b0e7ce9
tree69b2bc90a6db40c23888da85635d87becae5fa4f
parentd8260269c32c1c1140c8061ba469e28a75ccc159
[SimplifyLibCalls] avoid crash on pointer math

We could try harder to screen out libcalls by
function signature (and that would be a much larger
change than for sprintf alone), but that might make
the transition to type-less pointers more difficult.

https://llvm.org/PR51200
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/test/Transforms/InstCombine/stpcpy-1.ll