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:
parent
b3a29e8067
commit
9580d6a824
@ -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));
|
||||
|
6
test/Verifier/module-flags-3.ll
Normal file
6
test/Verifier/module-flags-3.ll
Normal 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)
|
Loading…
Reference in New Issue
Block a user