aboutsummaryrefslogtreecommitdiff
path: root/eval.h
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-11-30 19:03:53 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-11-30 19:03:53 +0900
commit28da2379c3b819088f0a503fcd0bfdd27ab40879 (patch)
treec887743ca9af92ec12c703678d329c21fb28ce51 /eval.h
parent77be80dde684e25ba057dd5082d569178a4b2e39 (diff)
downloadkati-28da2379c3b819088f0a503fcd0bfdd27ab40879.tar.gz
[C++] Explicitly disallow $(shell) in other make constructs
Diffstat (limited to 'eval.h')
-rw-r--r--eval.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/eval.h b/eval.h
index 3ebb21b..6bc21b9 100644
--- a/eval.h
+++ b/eval.h
@@ -92,6 +92,14 @@ class Evaluator {
return used_undefined_vars_;
}
+ int eval_depth() const { return eval_depth_; }
+ void IncrementEvalDepth() {
+ eval_depth_++;
+ }
+ void DecrementEvalDepth() {
+ eval_depth_--;
+ }
+
private:
Var* EvalRHS(Symbol lhs, Value* rhs, StringPiece orig_rhs, AssignOp op,
bool is_override = false);
@@ -112,6 +120,10 @@ class Evaluator {
bool is_bootstrap_;
bool avoid_io_;
+ // This value tracks the nest level of make expressions. For
+ // example, $(YYY) in $(XXX $(YYY)) is evaluated with depth==2.
+ // This will be used to disallow $(shell) in other make constructs.
+ int eval_depth_;
// Commands which should run at ninja-time (i.e., info, warning, and
// error).
vector<string> delayed_output_commands_;