From 3c5cfdf2e7e53967eb330928aaeedfbb8ea1db4d Mon Sep 17 00:00:00 2001 From: Philipp Brüschweiler Date: Thu, 4 Jul 2013 19:51:11 +0200 Subject: libsyntax: fix infinite loop when recursively including modules Fixes #7276 --- src/libsyntax/parse/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libsyntax/parse/mod.rs') diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 6dd8d4880e3..67ae695508b 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -44,6 +44,8 @@ pub struct ParseSess { cm: @codemap::CodeMap, // better be the same as the one in the reader! next_id: node_id, span_diagnostic: @span_handler, // better be the same as the one in the reader! + /// Used to determine and report recursive mod inclusions + included_mod_stack: ~[Path], } pub fn new_parse_sess(demitter: Option) -> @mut ParseSess { @@ -52,6 +54,7 @@ pub fn new_parse_sess(demitter: Option) -> @mut ParseSess { cm: cm, next_id: 1, span_diagnostic: mk_span_handler(mk_handler(demitter), cm), + included_mod_stack: ~[], } } @@ -62,6 +65,7 @@ pub fn new_parse_sess_special_handler(sh: @span_handler, cm: cm, next_id: 1, span_diagnostic: sh, + included_mod_stack: ~[], } } -- cgit 1.4.1-3-g733a5