Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71549 - in sandbox/local: boost/local/aux_ boost/local/aux_/function_macros libs/local/example tools
From: lorcaminiti_at_[hidden]
Date: 2011-04-27 15:46:14


Author: lcaminiti
Date: 2011-04-27 15:46:13 EDT (Wed, 27 Apr 2011)
New Revision: 71549
URL: http://svn.boost.org/trac/boost/changeset/71549

Log:
Fixed bug that cause recursive calls to segfault (init_recursion was called before init_call in code generated by NAME macro but init_call initializes global functor used by init_recursion -- reverted the order calling init_recursion only after init_call).
Text files modified:
   sandbox/local/boost/local/aux_/config.hpp | 2 +-
   sandbox/local/boost/local/aux_/function_macros/name.hpp | 13 ++++++-------
   sandbox/local/libs/local/example/Jamfile.jam | 2 ++
   sandbox/local/libs/local/example/profile_boost_local_inline.cpp | 2 +-
   sandbox/local/tools/lorenzo-boost-env-windows.bat | 4 ++--
   5 files changed, 12 insertions(+), 11 deletions(-)

Modified: sandbox/local/boost/local/aux_/config.hpp
==============================================================================
--- sandbox/local/boost/local/aux_/config.hpp (original)
+++ sandbox/local/boost/local/aux_/config.hpp 2011-04-27 15:46:13 EDT (Wed, 27 Apr 2011)
@@ -18,7 +18,7 @@
 # endif
 #endif
 
-#if BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS
+#if defined(BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS)
 # define BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS_01 1
 #else
 # define BOOST_LOCAL_AUX_CONFIG_LOCAL_TYPES_AS_TPARAMS_01 0

Modified: sandbox/local/boost/local/aux_/function_macros/name.hpp
==============================================================================
--- sandbox/local/boost/local/aux_/function_macros/name.hpp (original)
+++ sandbox/local/boost/local/aux_/function_macros/name.hpp 2011-04-27 15:46:13 EDT (Wed, 27 Apr 2011)
@@ -45,14 +45,13 @@
     /* non-local functor can always be passed as tparam (but slower) */ \
     BOOST_TYPEOF(local_functor_name.local_function_name) \
             nonlocal_functor_name; \
- /* run-time: the following order in which the functors are set is */ \
- /* important to allow for compiler optimization (changing this order */ \
- /* and/or moving some of these sets into the functor constructors might */ \
- /* prevent compiler optimizations) */ \
- local_functor_name.BOOST_LOCAL_AUX_FUNCTION_NAME_INIT_RECURSION_FUNC_( \
- nonlocal_functor_name); \
+ /* the following order should not be changed because init_recurion can */ \
+ /* be called only after init_call (because init_call init the glocal */ \
+ /* functor used by init_recursion) -- otherwise run-time error */ \
     local_functor_name.BOOST_LOCAL_AUX_SYMBOL_INIT_CALL_FUNCTION_NAME( \
- &local_functor_name, nonlocal_functor_name);
+ &local_functor_name, nonlocal_functor_name); \
+ local_functor_name.BOOST_LOCAL_AUX_FUNCTION_NAME_INIT_RECURSION_FUNC_( \
+ nonlocal_functor_name);
 
 #define BOOST_LOCAL_AUX_FUNCTION_NAME_FUNCTOR_(local_function_name) \
     BOOST_LOCAL_AUX_INTERNAL_SYMBOL(local_function_name)

Modified: sandbox/local/libs/local/example/Jamfile.jam
==============================================================================
--- sandbox/local/libs/local/example/Jamfile.jam (original)
+++ sandbox/local/libs/local/example/Jamfile.jam 2011-04-27 15:46:13 EDT (Wed, 27 Apr 2011)
@@ -22,6 +22,8 @@
 # Boost.Chrono (which needs Boost.System) for GCC (not part of official Boost release yet).
 lib libboost_chrono : : <file>$(BOOST_ROOT)/stage/lib/libboost_chrono.so ;
 lib libboost_system : : <file>$(BOOST_ROOT)/stage/lib/libboost_system.so ;
+#lib libboost_chrono : : ;
+#lib libboost_system : : ;
 
 exe add : add.cpp ;
 exe add_va : add_va.cpp ;

Modified: sandbox/local/libs/local/example/profile_boost_local_inline.cpp
==============================================================================
--- sandbox/local/libs/local/example/profile_boost_local_inline.cpp (original)
+++ sandbox/local/libs/local/example/profile_boost_local_inline.cpp 2011-04-27 15:46:13 EDT (Wed, 27 Apr 2011)
@@ -18,7 +18,7 @@
     void BOOST_LOCAL_FUNCTION_PARAMS( (const double& num)
             (bind& sum) (const bind& factor) ) {
         sum += factor * num;
- } BOOST_LOCAL_FUNCTION_NAME(inline add) // Note the `inline` specifier.
+ } BOOST_LOCAL_FUNCTION_NAME(inline add) // inlined
     boost::chrono::duration<double> decl_sec =
             boost::chrono::system_clock::now() - start;
 

Modified: sandbox/local/tools/lorenzo-boost-env-windows.bat
==============================================================================
--- sandbox/local/tools/lorenzo-boost-env-windows.bat (original)
+++ sandbox/local/tools/lorenzo-boost-env-windows.bat 2011-04-27 15:46:13 EDT (Wed, 27 Apr 2011)
@@ -16,8 +16,8 @@
 ECHO However, you do not strictly need to do this because you can use any compiler to build the examples (just add this headers-only library to your #include path) and you do not need to re-build the documentation.
 ECHO.
 
-set BOOST_ROOT=C:\PROGRA~1\boost\boost_1_46_1
-REM set BOOST_ROOT=e:\sandbox\boost-trunk
+REM set BOOST_ROOT=C:\PROGRA~1\boost\boost_1_46_1
+set BOOST_ROOT=e:\sandbox\boost-trunk
 set LIBPATH=%LIBPATH%;%BOOST_ROOT%\stage\lib
 set BOOST=%BOOST_ROOT%
 set BOOST_BUILD_PATH=%BOOST_ROOT%\tools\build\v2


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk