We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm using boost 1.83 and gcc13.2 and can see a gcc compiler warning about a potential null de-reference.
In function 'boost::json::result<T> boost::json::detail::value_to_impl(sequence_conversion_tag, boost::json::try_value_to_tag<T>, const boost::json::value&, const Ctx&) [with T = std::array<unsigned char, 128>; Ctx = std::tuple<allow_exceptions, no_context>]', inlined from 'typename boost::json::result_for<T, boost::json::value>::type boost::json::try_value_to(const value&, const Context&) [with T = std::array<unsigned char, 128>; Context = std::tuple<detail::allow_exceptions, detail::no_context>]' at /usr/include/boost/json/value_to.hpp:230:33: /usr/include/boost/json/detail/value_to.hpp:315:16: warning: potential null pointer dereference [-Wnull-dereference] 315 | *ins++ = std::move(*elem_res);
Is the check elem_res.has_error() insufficient to guarantee that no null-pointer de-reference will happen?
elem_res.has_error()
The text was updated successfully, but these errors were encountered:
I couldn't reproduce it. Can you please change this snippet (https://godbolt.org/z/4az5z7eva ), so that it hits that warning?
Sorry, something went wrong.
@grisumbras I can see issue in a larger code base. Will try to re-create in a smaller context.
No branches or pull requests
I'm using boost 1.83 and gcc13.2 and can see a gcc compiler warning about a potential null de-reference.
Is the check
elem_res.has_error()
insufficient to guarantee that no null-pointer de-reference will happen?The text was updated successfully, but these errors were encountered: