adb: avoid freeing argv entries on Windows.
We assign string literals directly to argv[0], which leads to fun explosions when we attempt to free when the runtime can detect that a bad free happened, which seems to happen reliably with lld. Bug: http://b/110800681 Test: `adb shell true` on windows Change-Id: Ica81e472c31686d80b58c41ff6d2b825baef06fb
This commit is contained in:
parent
8958d7a127
commit
e72c44b24a
1 changed files with 3 additions and 1 deletions
|
@ -2606,7 +2606,9 @@ extern "C" int main(int argc, char** argv);
|
|||
extern "C" int wmain(int argc, wchar_t **argv) {
|
||||
// Convert args from UTF-16 to UTF-8 and pass that to main().
|
||||
NarrowArgs narrow_args(argc, argv);
|
||||
return main(argc, narrow_args.data());
|
||||
|
||||
// Avoid destructing NarrowArgs: argv might have been mutated to point to string literals.
|
||||
_exit(main(argc, narrow_args.data()));
|
||||
}
|
||||
|
||||
// Shadow UTF-8 environment variable name/value pairs that are created from
|
||||
|
|
Loading…
Reference in a new issue