diff options
author | Zachary Turner <zturner@google.com> | 2014-07-09 16:32:07 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2014-07-09 16:32:07 +0000 |
commit | df734cdd39cd3ad90f4f4466ddb497ffc14c1258 (patch) | |
tree | 30a2656ef6dced5edac95193d95ec1c200c7c126 /lldb/source/Interpreter/OptionGroupString.cpp | |
parent | d37221dc5d819d63dbe35ab9a2d60e73cbd52dbd (diff) | |
download | bcm5719-llvm-df734cdd39cd3ad90f4f4466ddb497ffc14c1258.tar.gz bcm5719-llvm-df734cdd39cd3ad90f4f4466ddb497ffc14c1258.zip |
Fix tests broken by the OptionValidator changes.
The getopt library has a structure called option (lowercase). We
have a structure called Option (uppercase). previously the two
structures had exactly the same definitions, and we were doing a
C-style cast of an Option* to an option*. C-style casts don't
bother to warn you when you cast to unrelated types, but in the
original OptionValidator patch I modified the definition of Option.
This patch fixes the errors by building an array of option
structures and filling it out the correct way before passing it to
the getopt library.
This also fixes one other source of test failures: an uninitialized
read that occurs due to not initializing a field of the
OptionDefinition.
Reviewed By: Todd Fiala
Differential Revision: http://reviews.llvm.org/D4425
llvm-svn: 212628
Diffstat (limited to 'lldb/source/Interpreter/OptionGroupString.cpp')
-rw-r--r-- | lldb/source/Interpreter/OptionGroupString.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/OptionGroupString.cpp b/lldb/source/Interpreter/OptionGroupString.cpp index 3c013c6d621..9bc1c94d3a5 100644 --- a/lldb/source/Interpreter/OptionGroupString.cpp +++ b/lldb/source/Interpreter/OptionGroupString.cpp @@ -31,6 +31,7 @@ OptionGroupString::OptionGroupString (uint32_t usage_mask, m_option_definition.required = required; m_option_definition.long_option = long_option; m_option_definition.short_option = short_option; + m_option_definition.validator = nullptr; m_option_definition.option_has_arg = OptionParser::eRequiredArgument; m_option_definition.enum_values = nullptr; m_option_definition.completion_type = completion_type; |