1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

Verifier: Diagnose module flags which have null ID operands

llvm-svn: 229361
This commit is contained in:
David Majnemer 2015-02-16 08:14:22 +00:00
parent b3a29e8067
commit 9580d6a824
2 changed files with 7 additions and 1 deletions

View File

@ -877,7 +877,7 @@ Verifier::visitModuleFlag(const MDNode *Op,
"invalid behavior operand in module flag (unexpected constant)",
Op->getOperand(0));
}
MDString *ID = dyn_cast<MDString>(Op->getOperand(1));
MDString *ID = dyn_cast_or_null<MDString>(Op->getOperand(1));
Assert1(ID,
"invalid ID operand in module flag (expected metadata string)",
Op->getOperand(1));

View File

@ -0,0 +1,6 @@
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
!llvm.module.flags = !{!0}
!0 = !{i32 1, null, null}
; CHECK: invalid ID operand in module flag (expected metadata string)