mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-03 20:29:56 -06:00
The function `cmFortranParser_FilePush` was always processing the provided (included) file, even though it may have been processed before. This lead to infinite recursion in cases where the include guards were not properly interpreted, e.g. `# if !defined` instead of `#ifndef`. This commit introduces a cache of paths to already processed files. These files are now ignored in `cmFortranParser_FilePush` (treated as non-existing). Fixes: #27238
15 lines
526 B
Plaintext
15 lines
526 B
Plaintext
! CMake Fortran parser does not understand the `#if !defined(...)`
|
|
! syntax, so it does not guard against recursive inclusion. Unless
|
|
! the parser keeps track of already visited files, this leads to
|
|
! processing of around 2^N files, where N is the maximal number of
|
|
! open files. Because N is typically of the order of 1000, without
|
|
! bookkeeping this test hangs.
|
|
|
|
#if !defined(test_include_loop_fh)
|
|
#define test_include_loop_fh
|
|
|
|
#include "test_include_loop.fh"
|
|
#include "test_include_loop.fh"
|
|
|
|
#endif
|