Skip to content

Commit

Permalink
Merge branch 'fortran-lang:main' into fpm-registry
Browse files Browse the repository at this point in the history
  • Loading branch information
henilp105 authored Mar 8, 2024
2 parents 7b94401 + f09d3d8 commit c4c0bb7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/fpm/dependency.f90
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,9 @@ recursive subroutine add_project_dependencies(self, package, root, main, error)
end if
end if

!> Ensure allocation fits
call resize(self%dep,self%ndep)

end subroutine add_project_dependencies

!> Add a list of dependencies to the dependency tree
Expand All @@ -430,6 +433,9 @@ subroutine add_dependencies(self, dependency, error)
end do
if (allocated(error)) return

!> Ensure allocation fits ndep
call resize(self%dep,self%ndep)

end subroutine add_dependencies

!> Add a single dependency node to the dependency tree
Expand Down Expand Up @@ -464,6 +470,10 @@ subroutine add_dependency_node(self, dependency, error)
end if
end if
else

!> Safety: reallocate if necessary
if (size(self%dep)==self%ndep) call resize(self%dep,self%ndep+1)

! New dependency: add from scratch
self%ndep = self%ndep + 1
self%dep(self%ndep) = dependency
Expand Down

0 comments on commit c4c0bb7

Please sign in to comment.