Fixes a crash with the following alias, which I use for printing the contents of pointer variables: ``` command alias vp v -P1 ``` At some point in the recent-ish past, parsing this alias has started crashing lldb. The problem is code that assumes the option and its value are separate. This assumption causes an index past the end of a vector. This fix changes `FindArgumentIndexForOption`. The function now returns a pair of indexes, the first index is the option, the second index is the index of the value. In the case of joined options like `-P1`, the two indexes are the same.
8 lines
215 B
Plaintext
8 lines
215 B
Plaintext
# Test that command alias with a joined argument (`-P1` in this test) is
|
|
# properly parsed (does not crash).
|
|
|
|
# RUN: %lldb < %s | FileCheck %s
|
|
command alias vptr frame variable -P1
|
|
help
|
|
# CHECK: {{^ *}}vptr{{ +}}--
|