Fix bug in method LLLexer::FP80HexToIntPair
authorKarl Schimpf <kschimpf@google.com>
Mon, 31 Aug 2015 21:36:14 +0000 (21:36 +0000)
committerKarl Schimpf <kschimpf@google.com>
Mon, 31 Aug 2015 21:36:14 +0000 (21:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246489 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/LLLexer.cpp
test/Assembler/invalid-fp80hex.ll [new file with mode: 0644]

index 6d62584577abc033837256ee09d1709972d90c9b..af7705c56664ffa00d63ab381f63d251ed7da2fc 100644 (file)
@@ -105,7 +105,7 @@ void LLLexer::FP80HexToIntPair(const char *Buffer, const char *End,
     Pair[1] += hexDigitValue(*Buffer);
   }
   Pair[0] = 0;
-  for (int i=0; i<16; i++, Buffer++) {
+  for (int i = 0; i < 16 && Buffer != End; i++, Buffer++) {
     Pair[0] *= 16;
     Pair[0] += hexDigitValue(*Buffer);
   }
diff --git a/test/Assembler/invalid-fp80hex.ll b/test/Assembler/invalid-fp80hex.ll
new file mode 100644 (file)
index 0000000..70c518d
--- /dev/null
@@ -0,0 +1,6 @@
+; RUN: not llvm-as < %s 2>&1 | FileCheck %s
+
+; Tests bug: 24640
+; CHECK: expected '=' in global variable
+
+@- 0xKate potb8ed