diff --git a/changelog b/changelog index 035bfa417320..49f56a97a5ec 100644 --- a/changelog +++ b/changelog @@ -73,6 +73,7 @@ Version 1.11.15+dev: * Fix bug in Random Recruit Micro AI: the AI can now handle custom castle terrain independent of its terrain code * Fix bug in Return Guardian Micro AI when there is no path to the return hex + * Fix bug #20126: Recursive preprocessor includes cause infinite loop Version 1.11.15: * Graphics: diff --git a/src/serialization/preprocessor.cpp b/src/serialization/preprocessor.cpp index 6f7638ab3750..f298d085fcaf 100644 --- a/src/serialization/preprocessor.cpp +++ b/src/serialization/preprocessor.cpp @@ -1053,7 +1053,7 @@ bool preprocessor_data::get_chunk() pop_token(); put(v.str()); } - else if ((macro = target_.defines_->find(symbol)) != target_.defines_->end()) + else if (target_.depth_ < 100 && (macro = target_.defines_->find(symbol)) != target_.defines_->end()) { preproc_define const &val = macro->second; size_t nb_arg = strings_.size() - token.stack_pos - 1;