Index: tools/gn/functions_target.cc |
diff --git a/tools/gn/functions_target.cc b/tools/gn/functions_target.cc |
index 655c32a5cbbe78466be2264069a73bfc624adf0c..45e685965371f77579b2e25c4a4e0ebd817f3eec 100644 |
--- a/tools/gn/functions_target.cc |
+++ b/tools/gn/functions_target.cc |
@@ -31,6 +31,10 @@ Value ExecuteGenericTarget(const char* target_type, |
const std::vector<Value>& args, |
BlockNode* block, |
Err* err) { |
+ NonNestableBlock non_nestable(scope, function, "target"); |
+ if (!non_nestable.Enter(err)) |
+ return Value(); |
+ |
if (!EnsureNotProcessingImport(function, scope, err) || |
!EnsureNotProcessingBuildConfig(function, scope, err)) |
return Value(); |