src/gray_errors.f90: fix possible null prt dereference

This commit is contained in:
Michele Guerini Rocco 2025-03-21 08:30:20 +01:00
parent 65b9d129ea
commit c3a3972378
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450

View File

@ -142,8 +142,11 @@ contains
integer, intent(in), optional :: subcase
integer(kind=gray_error) :: raise_error
raise_error = ibset(error, spec%offset &
+ merge(subcase, 0, present(subcase)))
if (present(subcase)) then
raise_error = ibset(error, spec%offset + subcase)
else
raise_error = ibset(error, spec%offset)
end if
end function raise_error