diff options
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-11-30 19:03:53 +0900 |
---|---|---|
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-11-30 19:03:53 +0900 |
commit | 28da2379c3b819088f0a503fcd0bfdd27ab40879 (patch) | |
tree | c887743ca9af92ec12c703678d329c21fb28ce51 /eval.h | |
parent | 77be80dde684e25ba057dd5082d569178a4b2e39 (diff) | |
download | kati-28da2379c3b819088f0a503fcd0bfdd27ab40879.tar.gz |
[C++] Explicitly disallow $(shell) in other make constructs
Diffstat (limited to 'eval.h')
-rw-r--r-- | eval.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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_; |