From ddd6ce04ecc2cd86c77f43b61563652b2a801fed Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 4 Mar 2008 18:57:14 -0500 Subject: [PATCH] BUG: Make sure at least one policy stack entry is created for every cmMakefile instance. --- Source/cmMakefile.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index a7488bd83..9d109b66d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -46,6 +46,9 @@ cmMakefile::cmMakefile() { this->DefinitionStack.push_back(DefinitionMap()); + // Enter a policy level for this directory. + this->PushPolicy(); + // Setup the default include file regular expression (match everything). this->IncludeFileRegularExpression = "^.*$"; // Setup the default include complaint regular expression (match nothing). @@ -3314,7 +3317,7 @@ bool cmMakefile::PushPolicy() bool cmMakefile::PopPolicy() { - if (PolicyStack.size() == 0) + if (PolicyStack.size() == 1) { cmSystemTools::Error("Attempt to pop the policy stack past " "it's beginning.");