Author: Simon Pilgrim Date: 2022-10-25T17:44:04+01:00 New Revision: 93a5a03030ab9f49120f7bd2ec8e84f063da9987
URL: https://github.com/llvm/llvm-project/commit/93a5a03030ab9f49120f7bd2ec8e84f063da9987 DIFF: https://github.com/llvm/llvm-project/commit/93a5a03030ab9f49120f7bd2ec8e84f063da9987.diff LOG: [lldb] Host::ShellExpandArguments - fix error check for valid dictionary Fix repeated check for a valid JSON parse and actually check the dictionary pointer Reported here: https://pvs-studio.com/en/blog/posts/cpp/1003/ (N40) Added: Modified: lldb/source/Host/windows/Host.cpp Removed: ################################################################################ diff --git a/lldb/source/Host/windows/Host.cpp b/lldb/source/Host/windows/Host.cpp index df7859d9b46c9..6908f0003eaf7 100644 --- a/lldb/source/Host/windows/Host.cpp +++ b/lldb/source/Host/windows/Host.cpp @@ -245,7 +245,7 @@ Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) { } auto dict_sp = data_sp->GetAsDictionary(); - if (!data_sp) { + if (!dict_sp) { error.SetErrorString("invalid JSON"); return error; } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits