summaryrefslogtreecommitdiffstats
path: root/Source/cmDependsFortran.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-04-21 15:15:56 (GMT)
committerBrad King <brad.king@kitware.com>2008-04-21 15:15:56 (GMT)
commit52898fe9250aaa16904640874852c45bfc4c325b (patch)
tree33eaa264d38846f3cf75bd8122c4967483f1bc52 /Source/cmDependsFortran.cxx
parentfd0690fcebc2c7a0e50a51bce62f4774900b9f07 (diff)
downloadCMake-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.cxx6
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;
}