about summary refs log tree commit diff
path: root/src/libsyntax/parse/mod.rs
diff options
context:
space:
mode:
authorPhilipp Brüschweiler <blei42@gmail.com>2013-07-04 19:51:11 +0200
committerPhilipp Brüschweiler <blei42@gmail.com>2013-07-04 19:51:11 +0200
commit3c5cfdf2e7e53967eb330928aaeedfbb8ea1db4d (patch)
tree93c967b5fc92afe2c322d6ffe0f367f88a634a83 /src/libsyntax/parse/mod.rs
parentdd4f6bb2a2e0fe4f2f417b99301b44d12567c243 (diff)
downloadrust-3c5cfdf2e7e53967eb330928aaeedfbb8ea1db4d.tar.gz
rust-3c5cfdf2e7e53967eb330928aaeedfbb8ea1db4d.zip
libsyntax: fix infinite loop when recursively including modules
Fixes #7276
Diffstat (limited to 'src/libsyntax/parse/mod.rs')
-rw-r--r--src/libsyntax/parse/mod.rs4
1 files changed, 4 insertions, 0 deletions
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<Emitter>) -> @mut ParseSess {
@@ -52,6 +54,7 @@ pub fn new_parse_sess(demitter: Option<Emitter>) -> @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: ~[],
     }
 }