GTestSuite destroy methods in 2.70 cause double free
Hello! Here is a sample reproduction program:
int main(string[] args)
{
Test.init(ref args);
var suite = new TestSuite("suite");
TestSuite.get_root().add_suite(suite);
return Test.run();
}
With valac
, the following is generated and everything works fine:
_tmp0_ = g_test_create_suite ("suite");
suite = _tmp0_;
_tmp1_ = g_test_get_root ();
g_test_suite_add_suite (_tmp1_, suite);
result = g_test_run ();
With valac --target-glib=2.70
, the following is generated and you get a bad free inside of g_test_run.
_tmp0_ = g_test_create_suite ("suite");
suite = _tmp0_;
_tmp1_ = g_test_get_root ();
_tmp2_ = _tmp1_;
g_test_suite_add_suite (_tmp2_, suite);
_g_test_suite_free0 (_tmp2_);
result = g_test_run ();
_g_test_suite_free0 (suite);