소스 검색

core: fix double-free when copying an empty object

Daniele Bartolini 5 년 전
부모
커밋
9304ae5505
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  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)
 		for (s32 i = 0; i < 100; ++i)
 			ENSURE(!hash_set::has(m, i*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();
 	memory_globals::shutdown();
 }
 }