File tree Expand file tree Collapse file tree
sources/LLVMSharp.Interop/Extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -459,7 +459,7 @@ public readonly LLVMLinkage Linkage
459459 }
460460 }
461461
462- public readonly uint MDNodeOperandsCount => ( Kind == LLVMValueKind . LLVMMetadataAsValueValueKind ) ? LLVM . GetMDNodeNumOperands ( this ) : default ;
462+ public readonly uint MDNodeOperandsCount => ( IsAMDNode == null ) ? LLVM . GetMDNodeNumOperands ( this ) : default ;
463463
464464 public readonly string Name
465465 {
@@ -895,19 +895,20 @@ public readonly void GetBasicBlocks(Span<LLVMBasicBlockRef> destination)
895895
896896 public readonly LLVMValueRef [ ] GetMDNodeOperands ( )
897897 {
898- if ( Kind != LLVMValueKind . LLVMMetadataAsValueValueKind )
898+ uint count = MDNodeOperandsCount ;
899+ if ( count == 0 )
899900 {
900901 return [ ] ;
901902 }
902903
903- var destination = new LLVMValueRef [ MDNodeOperandsCount ] ;
904+ var destination = new LLVMValueRef [ count ] ;
904905 GetMDNodeOperands ( destination ) ;
905906 return destination ;
906907 }
907908
908909 public readonly void GetMDNodeOperands ( Span < LLVMValueRef > destination )
909910 {
910- if ( Kind != LLVMValueKind . LLVMMetadataAsValueValueKind )
911+ if ( IsAMDNode == null )
911912 {
912913 return ;
913914 }
You can’t perform that action at this time.
0 commit comments