test_limit_reference: clang-tidy complains about possible use of freed memory · Issue #44 · libsigcplusplus/libsigcplusplus · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

test_limit_reference: clang-tidy complains about possible use of freed memory #44

Closed
@murraycu

Description

@murraycu

I can't remember if we've noticed this before, but it might need investigation:

clang-tidy-9 -p=/home/murrayc/checkout/github/libsigcplusplus/cmake_build /home/murrayc/checkout/github/libsigcplusplus/tests/test_limit_reference.cc
/home/murrayc/checkout/github/libsigcplusplus/sigc++/limit_reference.h:113:35: warning: Use of memory after it is freed [clang-analyzer-cplusplus.NewDelete]
inline T_type& invoke() const { return invoked; }
^
/home/murrayc/checkout/github/libsigcplusplus/tests/test_limit_reference.cc:37:7: note: Assuming the condition is false
if (!util->check_command_args(argc, argv))
^
/home/murrayc/checkout/github/libsigcplusplus/tests/test_limit_reference.cc:37:3: note: Taking false branch
if (!util->check_command_args(argc, argv))
^
/home/murrayc/checkout/github/libsigcplusplus/tests/test_limit_reference.cc:40:19: note: Memory is allocated
auto instance = new Derived();
^
/home/murrayc/checkout/github/libsigcplusplus/tests/test_limit_reference.cc:53:3: note: Memory is released
delete instance;
^
/home/murrayc/checkout/github/libsigcplusplus/tests/test_limit_reference.cc:56:3: note: Calling 'bind_functor::operator()'
param();
^
/home/murrayc/checkout/github/libsigcplusplus/sigc++/adaptors/bind.h:190:26: note: Calling 'tuple_transform_each<internal::TransformEachInvoker, std::tuple<sigc::bound_argument<std::reference_wrapper<(anonymous namespace)::Derived> > > &>'
const auto t_bound = internal::tuple_transform_eachinternal::TransformEachInvoker(bound_);
^
/home/murrayc/checkout/github/libsigcplusplus/sigc++/tuple-utils/tuple_transform_each.h:103:10: note: Calling 'tuple_transform_each_impl::tuple_transform_each'
return detail::tuple_transform_each_impl<T_transformer, size>::tuple_transform_each(
^
/home/murrayc/checkout/github/libsigcplusplus/sigc++/tuple-utils/tuple_transform_each.h:39:19: note: 1 is not equal to 0
if constexpr (size_from_index == 0)
^
/home/murrayc/checkout/github/libsigcplusplus/sigc++/tuple-utils/tuple_transform_each.h:39:5: note: Taking false branch
if constexpr (size_from_index == 0)
^
/home/murrayc/checkout/github/libsigcplusplus/sigc++/tuple-utils/tuple_transform_each.h:63:9: note: Calling 'TransformEachInvoker::transform'
T_transformer<from_element_type>::transform(std::get(t_original)));
^
/home/murrayc/checkout/github/libsigcplusplus/sigc++/adaptors/bind.h:110:74: note: Calling 'bound_argument::invoke'
constexpr static decltype(auto) transform(T_element& element) { return element.invoke(); }
^
/home/murrayc/checkout/github/libsigcplusplus/sigc++/adaptors/bound_argument.h:96:39: note: Calling 'limit_reference::invoke'
inline T_wrapped& invoke() { return visited_.invoke(); }
^
/home/murrayc/checkout/github/libsigcplusplus/sigc++/limit_reference.h:113:35: note: Use of memory after it is freed
inline T_type& invoke() const { return invoked; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      TMZ Celebrity News – Breaking Stories, Videos & Gossip

      Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

      Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

      🎥 Watch TMZ Live

      TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.