Access violation due to assignment to an optional variable that was not presented in a procedure of open_hashmap_type
#704
Labels
bug
Something isn't working
Description
I wrote an example of hashmaps usage like below:
When using the
open_hashmap_type
, the program is abnormally terminated.Expected Behaviour
I expected that the program finished without error and showed the message blow:
100 is mapped to apple
The program normally finished if I changed from the
open_hashmap_type
to thechaining_hashmap_type
.Version of stdlib
31f5a8b
Platform and Architecture
Windows 10 22H2 64bit, gfortran 11.2 bundled with quickstart Fortran on Windows, Intel Fortran 2021.5.0
Additional Information
To determine the cause of this abnormal termination, re-build and re-run with the following command:
Intel Fortran clarified that the error occurred on line 286 of
stdlib_hashmap_open.f90
On line 286, a logical value
.true.
is assigned to the optional argumentexists
without the presence check, as is done on line 278.stdlib/src/stdlib_hashmap_open.f90
Lines 277 to 288 in 2fdfab4
Line 286 can be modified to make the
open_hashmap_type
safer and more robust.The text was updated successfully, but these errors were encountered: