File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
sources/LLVMSharp.Interop/Extensions Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -467,7 +467,7 @@ public readonly LLVMLinkage Linkage
467467 }
468468 }
469469
470- public readonly uint MDNodeOperandsCount => ( Kind == LLVMValueKind . LLVMMetadataAsValueValueKind ) ? LLVM . GetMDNodeNumOperands ( this ) : default ;
470+ public readonly uint MDNodeOperandsCount => ( IsAMDNode == null ) ? LLVM . GetMDNodeNumOperands ( this ) : default ;
471471
472472 public readonly string Name
473473 {
@@ -969,19 +969,20 @@ public readonly IEnumerable<LLVMValueRef> GetInstructions()
969969
970970 public readonly LLVMValueRef [ ] GetMDNodeOperands ( )
971971 {
972- if ( Kind != LLVMValueKind . LLVMMetadataAsValueValueKind )
972+ uint count = MDNodeOperandsCount ;
973+ if ( count == 0 )
973974 {
974975 return [ ] ;
975976 }
976977
977- var destination = new LLVMValueRef [ MDNodeOperandsCount ] ;
978+ var destination = new LLVMValueRef [ count ] ;
978979 GetMDNodeOperands ( destination ) ;
979980 return destination ;
980981 }
981982
982983 public readonly void GetMDNodeOperands ( Span < LLVMValueRef > destination )
983984 {
984- if ( Kind != LLVMValueKind . LLVMMetadataAsValueValueKind )
985+ if ( IsAMDNode == null )
985986 {
986987 return ;
987988 }
You can’t perform that action at this time.
0 commit comments