mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-03 14:31:10 +00:00
Verifier: Diagnose module flags which have null ID operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229361 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
74b9ad3485
commit
815c05d38c
@ -877,7 +877,7 @@ Verifier::visitModuleFlag(const MDNode *Op,
|
|||||||
"invalid behavior operand in module flag (unexpected constant)",
|
"invalid behavior operand in module flag (unexpected constant)",
|
||||||
Op->getOperand(0));
|
Op->getOperand(0));
|
||||||
}
|
}
|
||||||
MDString *ID = dyn_cast<MDString>(Op->getOperand(1));
|
MDString *ID = dyn_cast_or_null<MDString>(Op->getOperand(1));
|
||||||
Assert1(ID,
|
Assert1(ID,
|
||||||
"invalid ID operand in module flag (expected metadata string)",
|
"invalid ID operand in module flag (expected metadata string)",
|
||||||
Op->getOperand(1));
|
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…
x
Reference in New Issue
Block a user