Maybe this isn't the right fix - msbit and lsbit probably shouldn't be
printed if to_integer returns false in the diagnostic on line 195. If that
diagnostic didn't use the variables, then I don't think this'd warn?

On Mon, Sep 27, 2021 at 12:38 AM Krasimir Georgiev via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

>
> Author: Krasimir Georgiev
> Date: 2021-09-27T09:35:58+02:00
> New Revision: 92b475f0b079e125c588b121dc50116ea5d6d9f2
>
> URL:
> https://github.com/llvm/llvm-project/commit/92b475f0b079e125c588b121dc50116ea5d6d9f2
> DIFF:
> https://github.com/llvm/llvm-project/commit/92b475f0b079e125c588b121dc50116ea5d6d9f2.diff
>
> LOG: [lldb] silence -Wsometimes-uninitialized warnings
>
> No functional changes intended.
>
> Silence warnings from
>
> https://github.com/llvm/llvm-project/commit/3a6ba3675177cb5e47dee325f300aced4cd864ed
> .
>
> Added:
>
>
> Modified:
>     lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
> b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
> index a3a9d963c2213..f6a2cdf309815 100644
> --- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
> +++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
> @@ -141,8 +141,8 @@ DynamicRegisterInfo::SetRegisterInfo(const
> StructuredData::Dictionary &dict,
>            std::string reg_name_str = matches[1].str();
>            std::string msbit_str = matches[2].str();
>            std::string lsbit_str = matches[3].str();
> -          uint32_t msbit;
> -          uint32_t lsbit;
> +          uint32_t msbit = 0;
> +          uint32_t lsbit = 0;
>            if (llvm::to_integer(msbit_str, msbit) &&
>                llvm::to_integer(lsbit_str, lsbit)) {
>              if (msbit > lsbit) {
>
>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to