mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
Fix a use after free. Patch by Frits van Bommel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119842 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9ef65cbbc6
commit
a962b40f0b
@ -765,6 +765,15 @@ void cl::ParseCommandLineOptions(int argc, char **argv,
|
||||
}
|
||||
}
|
||||
|
||||
// Now that we know if -debug is specified, we can use it.
|
||||
// Note that if ReadResponseFiles == true, this must be done before the
|
||||
// memory allocated for the expanded command line is free()d below.
|
||||
DEBUG(dbgs() << "Args: ";
|
||||
for (int i = 0; i < argc; ++i)
|
||||
dbgs() << argv[i] << ' ';
|
||||
dbgs() << '\n';
|
||||
);
|
||||
|
||||
// Free all of the memory allocated to the map. Command line options may only
|
||||
// be processed once!
|
||||
Opts.clear();
|
||||
@ -779,12 +788,6 @@ void cl::ParseCommandLineOptions(int argc, char **argv,
|
||||
free(*i);
|
||||
}
|
||||
|
||||
DEBUG(dbgs() << "Args: ";
|
||||
for (int i = 0; i < argc; ++i)
|
||||
dbgs() << argv[i] << ' ';
|
||||
dbgs() << '\n';
|
||||
);
|
||||
|
||||
// If we had an error processing our arguments, don't let the program execute
|
||||
if (ErrorParsing) exit(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user