[PATCH] D41641: [MC] - Stop ignoring invalid meta data symbols.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 30 23:42:11 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL321599: [MC] - Stop ignoring invalid meta data symbols. (authored by grimar, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D41641?vs=128357&id=128368#toc
Repository:
rL LLVM
https://reviews.llvm.org/D41641
Files:
llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp
llvm/trunk/test/MC/ELF/metadata-declaration-errors.s
Index: llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp
===================================================================
--- llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp
+++ llvm/trunk/lib/MC/MCParser/ELFAsmParser.cpp
@@ -447,7 +447,7 @@
Lex();
StringRef Name;
if (getParser().parseIdentifier(Name))
- return true;
+ return TokError("invalid metadata symbol");
Associated = dyn_cast_or_null<MCSymbolELF>(getContext().lookupSymbol(Name));
if (!Associated || !Associated->isInSection())
return TokError("symbol is not in a section: " + Name);
Index: llvm/trunk/test/MC/ELF/metadata-declaration-errors.s
===================================================================
--- llvm/trunk/test/MC/ELF/metadata-declaration-errors.s
+++ llvm/trunk/test/MC/ELF/metadata-declaration-errors.s
@@ -0,0 +1,10 @@
+// RUN: not llvm-mc -triple x86_64-pc-linux-gnu %s \
+// RUN: -filetype=obj -o %t.o 2>&1 | FileCheck %s
+
+// Check we do not silently ignore invalid metadata symbol (123).
+// CHECK: error: invalid metadata symbol
+
+.section .foo,"a"
+.quad 0
+
+.section bar,"ao", at progbits,123
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41641.128368.patch
Type: text/x-patch
Size: 1106 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171231/a2adeec6/attachment.bin>
More information about the llvm-commits
mailing list