| Index: tools/gn/parse_tree.cc
|
| diff --git a/tools/gn/parse_tree.cc b/tools/gn/parse_tree.cc
|
| index ecc438b245aee02c62551efaee117796786dc02f..d1de9cbf3d78b6847557949f04418a12ecc985d4 100644
|
| --- a/tools/gn/parse_tree.cc
|
| +++ b/tools/gn/parse_tree.cc
|
| @@ -487,13 +487,18 @@ const IdentifierNode* IdentifierNode::AsIdentifier() const {
|
| }
|
|
|
| Value IdentifierNode::Execute(Scope* scope, Err* err) const {
|
| - const Value* value = scope->GetValue(value_.value(), true);
|
| + const Scope* found_in_scope = nullptr;
|
| + const Value* value = scope->GetValueWithScope(value_.value(), true,
|
| + &found_in_scope);
|
| Value result;
|
| if (!value) {
|
| *err = MakeErrorDescribing("Undefined identifier");
|
| return result;
|
| }
|
|
|
| + if (!EnsureNotReadingFromSameDeclareArgs(this, scope, found_in_scope, err))
|
| + return result;
|
| +
|
| result = *value;
|
| result.set_origin(this);
|
| return result;
|
|
|