]> granicus.if.org Git - gc/commitdiff
Fix test_cpp (ensure the collector recognizes pointers to interiors)
authorIvan Maidanski <ivmai@mail.ru>
Sat, 16 Jun 2012 08:34:06 +0000 (12:34 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 16 Jun 2012 08:34:06 +0000 (12:34 +0400)
* tests/test_cpp.cc (main): Call GC_set_all_interior_pointers(1)
before GC_INIT to ensure that the collector considers pointers to
object interiors as valid ones (such a pointer could emerge as
a result of a type cast to subclass in case of multiple inheritance);
add comment.

tests/test_cpp.cc

index 597d8088c82ab70e91c5ba0447b719c87ef33e1b..5197b0e457632bc3e6cdf724866e63f1dd357a29 100644 (file)
@@ -210,6 +210,9 @@ int APIENTRY WinMain( HINSTANCE instance ATTR_UNUSED,
   int main( int argc, char* argv[] ) {
 #endif
 
+    GC_set_all_interior_pointers(1);
+                        /* needed due to C++ multiple inheritance used  */
+
     GC_INIT();
 
     int i, iters, n;