From 76c7f96833e3e01760825929f8cfab76bcd6bfb8 Mon Sep 17 00:00:00 2001 From: janwas Date: Sat, 19 Nov 2005 04:13:37 +0000 Subject: [PATCH] add safety check to get_slot (this appears to be part of the error andrew is getting - possibly the victim of mem corruption) This was SVN commit r3151. --- source/lib/res/file/vfs_tree.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/lib/res/file/vfs_tree.cpp b/source/lib/res/file/vfs_tree.cpp index 5ce915d50d..e289dfc332 100644 --- a/source/lib/res/file/vfs_tree.cpp +++ b/source/lib/res/file/vfs_tree.cpp @@ -166,6 +166,7 @@ public: T* get_slot(Key key) { u32 hash = Hash(key); + debug_assert(max_entries != 0); // otherwise, mask will be incorrect const uint mask = max_entries-1; T* p; for(;;)