Fix Segmentation fault

This commit is contained in:
uazo 2023-01-30 17:41:10 +01:00 committed by GitHub
parent 45836ce3ae
commit 1dd51fda9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,6 +73,7 @@ index ed004ac8f1fe1a5107db8b1f5c02c4ba957daef4..bbb79da561ddec497863230cd99ffbe9
+
int NinjaMain::ToolCompilationDatabase(const Options* options, int argc, char* argv[]) {
+ std::vector<Edge*>* edges_to_process = &(state_.edges_);
+ std::vector<Edge*> user_interested_edges;
+
+ if (options->user_given_target) {
+ string err;
@ -83,7 +84,6 @@ index ed004ac8f1fe1a5107db8b1f5c02c4ba957daef4..bbb79da561ddec497863230cd99ffbe9
+ return 1;
+ }
+
+ std::vector<Edge*> user_interested_edges;
+ if (!GetAllDependentEdges(user_given_target, &user_interested_edges))
+ return 1;
+ edges_to_process = &user_interested_edges;