Index: tools/gn/function_process_file_template.cc |
diff --git a/tools/gn/function_process_file_template.cc b/tools/gn/function_process_file_template.cc |
index 78889c98fd8009b3a5ee8178ebc1101b9fec214d..28e3e4683c6407db0783dcbebb39f723b11fb34d 100644 |
--- a/tools/gn/function_process_file_template.cc |
+++ b/tools/gn/function_process_file_template.cc |
@@ -93,8 +93,15 @@ Value RunProcessFileTemplate(Scope* scope, |
return Value(); |
} |
+ auto& types = subst.required_types(); |
+ if (std::find(types.begin(), types.end(), |
+ SUBSTITUTION_SOURCE_TARGET_RELATIVE) != types.end()) { |
+ *err = Err(template_arg, "Not a valid substitution type for the function."); |
+ return Value(); |
+ } |
+ |
SubstitutionWriter::ApplyListToSourcesAsString( |
- scope->settings(), subst, input_files, &result_files); |
+ nullptr, scope->settings(), subst, input_files, &result_files); |
// Convert the list of strings to the return Value. |
Value ret(function, Value::LIST); |