-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[lldb][NFC] Small fixes identified by the clang static analyzer #148773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -477,6 +477,7 @@ static Status HandleFileAction(ProcessLaunchInfo &launch_info, | |
stringWithUTF8String:args.GetArgumentAtIndex(idx)]]; | ||
|
||
[options setObject:args_array forKey:kSimDeviceSpawnArguments]; | ||
[args_array release]; | ||
} | ||
|
||
NSMutableDictionary *env_dict = [[NSMutableDictionary alloc] init]; | ||
|
@@ -539,6 +540,8 @@ static Status HandleFileAction(ProcessLaunchInfo &launch_info, | |
: "unable to launch"); | ||
} | ||
|
||
[env_dict release]; | ||
[options release]; | ||
Comment on lines
+543
to
+544
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if these objc++ files can switch to using ARC (not that you should deal with that for this PR) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah I thought the same thing, but it's been so long since I touched any Objective-C code, I didn't want to try to modernize it properly. |
||
return CoreSimulatorSupport::Process(pid, std::move(error)); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,11 +218,8 @@ LanguageRuntime::LanguageRuntime(Process *process) : Runtime(process) {} | |
BreakpointPreconditionSP | ||
LanguageRuntime::GetExceptionPrecondition(LanguageType language, | ||
bool throw_bp) { | ||
LanguageRuntimeCreateInstance create_callback; | ||
for (uint32_t idx = 0; | ||
(create_callback = | ||
PluginManager::GetLanguageRuntimeCreateCallbackAtIndex(idx)) != | ||
nullptr; | ||
PluginManager::GetLanguageRuntimeCreateCallbackAtIndex(idx) != nullptr; | ||
idx++) { | ||
if (auto precondition_callback = | ||
PluginManager::GetLanguageRuntimeGetExceptionPreconditionAtIndex( | ||
|
@@ -289,12 +286,8 @@ void LanguageRuntime::InitializeCommands(CommandObject *parent) { | |
if (!parent->IsMultiwordObject()) | ||
return; | ||
|
||
LanguageRuntimeCreateInstance create_callback; | ||
|
||
for (uint32_t idx = 0; | ||
(create_callback = | ||
PluginManager::GetLanguageRuntimeCreateCallbackAtIndex(idx)) != | ||
nullptr; | ||
Comment on lines
-295
to
-297
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've noticed this unnecessary assignment in the for-loop before, thanks for deleting it. |
||
PluginManager::GetLanguageRuntimeCreateCallbackAtIndex(idx) != nullptr; | ||
++idx) { | ||
if (LanguageRuntimeGetCommandObject command_callback = | ||
PluginManager::GetLanguageRuntimeGetCommandObjectAtIndex(idx)) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit surprised by these ones. Why aren't these needed anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a local variable in the
DW_OP_piece
block, and we return with an error here. It's a dead store.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be that stylistically we want to set
dwarf4_location_description_kind
in every clause of this DW_OP_piece block, and we should set it to stay consistent.