Skip to content

Commit

Permalink
Ensure the TestType object lives for the duration of the test function
Browse files Browse the repository at this point in the history
Currently the temporary TestType object is destroyed immediately after
`depth_ntk` is initialized, leaving a dangling reference. This is caught
by ASAN.
  • Loading branch information
rocallahan committed Jun 27, 2024
1 parent bfcee23 commit 9fadc38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/views/rank_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ TEMPLATE_TEST_CASE( "compute ranks for a simple network", "[rank_view]", aig_net

TEMPLATE_TEST_CASE( "compute ranks during node construction", "[rank_view]", aig_network, mig_network, xag_network, xmg_network, klut_network, cover_network, buffered_aig_network, buffered_mig_network, crossed_klut_network, buffered_crossed_klut_network )
{
depth_view const depth_ntk{ TestType{} };
TestType ntk{};
depth_view const depth_ntk{ ntk };
rank_view rank_ntk{ depth_ntk };

auto const a = rank_ntk.create_pi();
Expand Down

0 comments on commit 9fadc38

Please sign in to comment.