|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75605 - in trunk/tools/build/v2: build engine
From: ghost_at_[hidden]
Date: 2011-11-22 06:20:43
Author: vladimir_prus
Date: 2011-11-22 06:20:42 EST (Tue, 22 Nov 2011)
New Revision: 75605
URL: http://svn.boost.org/trac/boost/changeset/75605
Log:
Fix a crash when using bjam.caller.
Patch from Juraj IvanÄiÄ
Text files modified:
trunk/tools/build/v2/build/toolset.py | 4 ++--
trunk/tools/build/v2/engine/builtins.c | 6 +++---
trunk/tools/build/v2/engine/compile.c | 1 +
3 files changed, 6 insertions(+), 5 deletions(-)
Modified: trunk/tools/build/v2/build/toolset.py
==============================================================================
--- trunk/tools/build/v2/build/toolset.py (original)
+++ trunk/tools/build/v2/build/toolset.py 2011-11-22 06:20:42 EST (Tue, 22 Nov 2011)
@@ -117,8 +117,8 @@
is specified, then the value of 'feature'
will be added.
"""
- caller = bjam.caller()[:-1]
- if not '.' in rule_or_module and caller.startswith("Jamfile"):
+ caller = bjam.caller()
+ if not '.' in rule_or_module and caller and caller[:-1].startswith("Jamfile"):
# Unqualified rule name, used inside Jamfile. Most likely used with
# 'make' or 'notfile' rules. This prevents setting flags on the entire
# Jamfile module (this will be considered as rule), but who cares?
Modified: trunk/tools/build/v2/engine/builtins.c
==============================================================================
--- trunk/tools/build/v2/engine/builtins.c (original)
+++ trunk/tools/build/v2/engine/builtins.c 2011-11-22 06:20:42 EST (Tue, 22 Nov 2011)
@@ -2140,9 +2140,9 @@
PyObject * bjam_caller( PyObject * self, PyObject * args )
{
- PyObject *result = PyString_FromString(
- frame_before_python_call->prev->module->name);
- return result;
+ if ( !frame_before_python_call )
+ Py_RETURN_NONE;
+ return PyString_FromString(frame_before_python_call->prev->module->name);
}
#endif /* #ifdef HAVE_PYTHON */
Modified: trunk/tools/build/v2/engine/compile.c
==============================================================================
--- trunk/tools/build/v2/engine/compile.c (original)
+++ trunk/tools/build/v2/engine/compile.c 2011-11-22 06:20:42 EST (Tue, 22 Nov 2011)
@@ -865,6 +865,7 @@
frame_before_python_call = frame;
py_result = PyObject_Call( r->python_function, arguments, kw );
+ frame_before_python_call = NULL;
Py_DECREF(arguments);
Py_XDECREF(kw);
if ( py_result != NULL )
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