From 93e87652f225dc4a36cbc8f24968c4582f8fe86c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 11 Mar 2009 16:14:25 +0000 Subject: fix PR3785, a valgrind error on test/CodeGen/ARM/pr3502.ll llvm-svn: 66660 --- llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp b/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp index d2965fe80f0..4107dccd2a6 100644 --- a/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp +++ b/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp @@ -185,8 +185,12 @@ unsigned ARMTargetAsmInfo::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()) { -- cgit v1.2.3