about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--llvm_mode/compare-transform-pass.so.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm_mode/compare-transform-pass.so.cc b/llvm_mode/compare-transform-pass.so.cc
index 10413076..2111b646 100644
--- a/llvm_mode/compare-transform-pass.so.cc
+++ b/llvm_mode/compare-transform-pass.so.cc
@@ -408,6 +408,7 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
      * the StringRef (in comparison to std::string a StringRef has built-in
      * runtime bounds checking, which makes debugging easier) */
     TmpConstStr.append("\0", 1);
+    if (!sizedLen) constLen++;
     ConstStr = StringRef(TmpConstStr);
     // fprintf(stderr, "issized: %d, const > sized ? %u > %u\n", isSizedcmp,
     // constLen, sizedLen);