diff options
Diffstat (limited to 'libbuild2/build/script/parser.cxx')
-rw-r--r-- | libbuild2/build/script/parser.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libbuild2/build/script/parser.cxx b/libbuild2/build/script/parser.cxx index 60000c2..b170088 100644 --- a/libbuild2/build/script/parser.cxx +++ b/libbuild2/build/script/parser.cxx @@ -248,7 +248,8 @@ namespace build2 // void parser:: - execute (const script& s, environment& e, runner& r) + execute (const scope& rs, const scope& bs, + environment& e, const script& s, runner& r) { path_ = nullptr; // Set by replays. @@ -256,6 +257,12 @@ namespace build2 set_lexer (nullptr); + // The script shouldn't be able to modify the scopes. + // + root_ = const_cast<scope*> (&rs); + scope_ = const_cast<scope*> (&bs); + pbase_ = scope_->src_path_; + script_ = const_cast<script*> (&s); runner_ = &r; environment_ = &e; |