Skip to content

Update fhash.f90#4

Open
vickysharma0812 wants to merge 1 commit intojl2922:masterfrom
vickysharma0812:patch-1
Open

Update fhash.f90#4
vickysharma0812 wants to merge 1 commit intojl2922:masterfrom
vickysharma0812:patch-1

Conversation

@vickysharma0812
Copy link

Updating next method

The following line:

do while (.not. associated(this%node_ptr) .or. .not. allocated(this%node_ptr%kv))

will cause problem.

When this%node_ptr not associated, and we access this%node_ptr%kv. it will cause segmentation fault.

Usually compiler does not have short circuit check like phthon and other language.

So I have modified this line.

    DO
      IF(ASSOCIATED(this%node_ptr)) THEN
        IF(ALLOCATED(this%node_ptr%kv) ) EXIT
      END IF

Updating next method 

The following line:

```fortran
do while (.not. associated(this%node_ptr) .or. .not. allocated(this%node_ptr%kv))
```
will cause problem. 

When `this%node_ptr` not associated, and we access `this%node_ptr%kv`. it will cause segmentation fault. 

Usually compiler does not have short circuit check like phthon and other language.

So I have modified this line. 

```fortran
    DO
      IF(ASSOCIATED(this%node_ptr)) THEN
        IF(ALLOCATED(this%node_ptr%kv) ) EXIT
      END IF
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments