diff options
author | Brad King <brad.king@kitware.com> | 2008-04-21 15:15:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-04-21 15:15:56 (GMT) |
commit | 52898fe9250aaa16904640874852c45bfc4c325b (patch) | |
tree | 33eaa264d38846f3cf75bd8122c4967483f1bc52 /Source/cmDependsFortran.cxx | |
parent | fd0690fcebc2c7a0e50a51bce62f4774900b9f07 (diff) | |
download | CMake-52898fe9250aaa16904640874852c45bfc4c325b.zip CMake-52898fe9250aaa16904640874852c45bfc4c325b.tar.gz CMake-52898fe9250aaa16904640874852c45bfc4c325b.tar.bz2 |
BUG: Fix Fortran dependency parser preprocessor handling crash.
- Do not crash if a #elseif occurs out of order
- Recognize preprocessor directives only at the beginning of lines.
- See issue #6855
Diffstat (limited to 'Source/cmDependsFortran.cxx')
-rw-r--r-- | Source/cmDependsFortran.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 577ebad..3d23b80 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -1209,7 +1209,8 @@ void cmDependsFortranParser_RuleElif(cmDependsFortranParser* parser) // Allways taken unless an #ifdef or #ifndef-branch has been taken // already. If the second condition isn't meet already // (parser->InPPFalseBranch == 0) correct it. - if(parser->SkipToEnd.top() && !parser->InPPFalseBranch) + if(!parser->SkipToEnd.empty() && + parser->SkipToEnd.top() && !parser->InPPFalseBranch) { parser->InPPFalseBranch = 1; } @@ -1226,7 +1227,8 @@ void cmDependsFortranParser_RuleElse(cmDependsFortranParser* parser) // parser->InPPFalseBranch is either 0 or 1. We change it denpending on // parser->SkipToEnd.top() - if(parser->SkipToEnd.top()) + if(!parser->SkipToEnd.empty() && + parser->SkipToEnd.top()) { parser->InPPFalseBranch = 1; } |