Skip to content

Commit f68db27

Browse files
author
git apple-llvm automerger
committed
Merge commit 'd384c3747fab' from swift/release/5.9 into stable/20221013
2 parents 77f3892 + d384c37 commit f68db27

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lldb/source/Interpreter/CommandAlias.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "lldb/Interpreter/CommandAlias.h"
1010

11+
#include "llvm/ADT/STLExtras.h"
1112
#include "llvm/Support/ErrorHandling.h"
1213

1314
#include "lldb/Interpreter/CommandInterpreter.h"
@@ -211,9 +212,9 @@ std::pair<lldb::CommandObjectSP, OptionArgVectorSP> CommandAlias::Desugar() {
211212
// FIXME: This doesn't work if the original alias fills a slot in the
212213
// underlying alias, since this just appends the two lists.
213214
auto desugared = ((CommandAlias *)underlying.get())->Desugar();
214-
auto options = GetOptionArguments();
215-
options->insert(options->begin(), desugared.second->begin(),
216-
desugared.second->end());
215+
OptionArgVectorSP options = std::make_shared<OptionArgVector>();
216+
llvm::append_range(*options, *desugared.second);
217+
llvm::append_range(*options, *GetOptionArguments());
217218
return {desugared.first, options};
218219
}
219220

lldb/test/API/commands/command/nested_alias/TestNestedAlias.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,7 @@ def cleanup():
101101
self.expect('command alias two expr -- 2')
102102
self.expect('command alias add_two two +')
103103
self.expect('add_two 3', patterns=[' = 5$'])
104+
# Check that aliases to aliases to raw input commands work the second
105+
# and subsequent times.
106+
self.expect('add_two 3', patterns=[' = 5$'])
107+
self.expect('add_two 3', patterns=[' = 5$'])

0 commit comments

Comments
 (0)