aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-11 16:14:25 +0000
committerChris Lattner <sabre@nondot.org>2009-03-11 16:14:25 +0000
commiteda2ec35a14df50590f4b0b15f4b85be8d4ed5a1 (patch)
tree7e37ae1d22675df922f35f1799cede5cc2a56fc6 /lib
parent9e8bd0b362c034e629b9ee1f32e4e1adf037f529 (diff)
fix PR3785, a valgrind error on test/CodeGen/ARM/pr3502.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/ARMTargetAsmInfo.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp
index d2965fe80f..4107dccd2a 100644
--- a/lib/Target/ARM/ARMTargetAsmInfo.cpp
+++ b/lib/Target/ARM/ARMTargetAsmInfo.cpp
@@ -185,8 +185,12 @@ unsigned ARMTargetAsmInfo<BaseTAI>::getInlineAsmLength(const char *s) const {
Str++;
break;
}
+
+ if (*Str == 0) break;
+
// Ignore everything from comment char(s) to EOL
- if (strncmp(Str, BaseTAI::CommentString, strlen(BaseTAI::CommentString))==-0)
+ if (strncmp(Str, BaseTAI::CommentString,
+ strlen(BaseTAI::CommentString)) == 0)
atInsnStart = false;
// FIXME do something like the following for non-Darwin
else if (*Str == '.' && Subtarget->isTargetDarwin()) {