[PATCH] D122836: [SimplifyLibCalls] Fold more memchr calls
Martin Sebor via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 1 15:39:02 PDT 2022
msebor added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:939
+ // is greater than 1.
+ Str = Str.substr(0, MaxLen);
+
----------------
efriedma wrote:
> This implicitly truncates MaxLen to 32 bits on 32-bit targets, which is probably not what you want.
You're right, silent truncation indeed isn't what I want here (or what I would have expected). Thanks for pointing out this gotcha!
It seems to be a pre-existing bug in the code made more apparent by the introduction of the `MaxLen` variable. Let me fix it and post another update.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122836/new/
https://reviews.llvm.org/D122836
More information about the llvm-commits
mailing list