mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-10 05:41:40 +00:00
[MC] - Stop ignoring invalid meta data symbols.
Previously llvm-mc would silently accept code from testcase, that contains invalid metadata symbol in section declaration. Patch fixes the issue. Differential revision: https://reviews.llvm.org/D41641 llvm-svn: 321599
This commit is contained in:
parent
56d68cd419
commit
ba60b14453
@ -447,7 +447,7 @@ bool ELFAsmParser::parseMetadataSym(MCSymbolELF *&Associated) {
|
||||
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);
|
||||
|
10
test/MC/ELF/metadata-declaration-errors.s
Normal file
10
test/MC/ELF/metadata-declaration-errors.s
Normal file
@ -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",@progbits,123
|
Loading…
Reference in New Issue
Block a user