Index: tools/gn/action_target_generator.cc |
diff --git a/tools/gn/action_target_generator.cc b/tools/gn/action_target_generator.cc |
index 6f962b6dd2a4379fe0576baa4422ca7165364cfb..5c7cbf67a8de2093676daea83feccdd8b38d6016 100644 |
--- a/tools/gn/action_target_generator.cc |
+++ b/tools/gn/action_target_generator.cc |
@@ -117,15 +117,32 @@ bool ActionTargetGenerator::FillScript() { |
bool ActionTargetGenerator::FillScriptArgs() { |
const Value* value = scope_->GetValue(variables::kArgs, true); |
if (!value) |
- return true; |
- return target_->action_values().args().Parse(*value, err_); |
+ return true; // Nothing to do. |
+ |
+ if (!target_->action_values().args().Parse(*value, err_)) |
+ return false; |
+ if (!EnsureValidSubstitutions( |
+ target_->action_values().args().required_types(), |
+ &IsValidScriptArgsSubstitution, |
+ value->origin(), err_)) |
+ return false; |
+ |
+ return true; |
} |
bool ActionTargetGenerator::FillResponseFileContents() { |
const Value* value = scope_->GetValue(variables::kResponseFileContents, true); |
if (!value) |
- return true; |
- return target_->action_values().rsp_file_contents().Parse(*value, err_); |
+ return true; // Nothing to do. |
+ |
+ if (!target_->action_values().rsp_file_contents().Parse(*value, err_)) |
+ return false; |
+ if (!EnsureValidSubstitutions( |
+ target_->action_values().rsp_file_contents().required_types(), |
+ &IsValidSourceSubstitution, value->origin(), err_)) |
+ return false; |
+ |
+ return true; |
} |
bool ActionTargetGenerator::FillDepfile() { |