Browse Source

core: fix double-free when copying an empty object

Daniele Bartolini 5 years ago
parent
commit
9304ae5505
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/core/unit_tests.cpp

+ 6 - 0
src/core/unit_tests.cpp

@@ -188,6 +188,12 @@ static void test_hash_set()
 		for (s32 i = 0; i < 100; ++i)
 			ENSURE(!hash_set::has(m, i*i));
 	}
+	{
+		HashSet<s32> ma(a);
+		HashSet<s32> mb(a);
+		hash_set::insert(ma, 0);
+		ma = mb;
+	}
 	memory_globals::shutdown();
 }