postgres.git / summary / log / commit / refs
commit aff66ef11314bf24863b503d9d8949c712e25100
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Thu Feb 18 23:50:27 2010 +0000
First released in: 9.0.0, 8.0.24, 8.1.20, 8.2.16, 8.3.10, 8.4.3
Volatile-ize all five places where we expect a PG_TRY block to restore
old memory context in plpython. Before only one of them was marked
volatile, but per report from Zdenek Kotala, some compilers do the
wrong thing here.
src/pl/plpython/plpython.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index bd87778d06e..8485aa6311b 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -1,7 +1,7 @@
/**********************************************************************
* plpython.c - python as a procedural language for PostgreSQL
*
- * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.90.2.5 2009/11/03 08:29:51 petere Exp $
+ * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.90.2.6 2010/02/18 23:50:27 tgl Exp $
*
*********************************************************************
*/
@@ -2273,7 +2273,7 @@ PLy_spi_prepare(PyObject * self, PyObject * args)
PyObject *volatile optr = NULL;
char *query;
void *tmpplan;
- MemoryContext oldcontext;
+ volatile MemoryContext oldcontext;
/* Can't execute more if we have an unhandled error */
if (PLy_error_in_progress)
@@ -2431,7 +2431,7 @@ PLy_spi_execute_plan(PyObject * ob, PyObject * list, long limit)
int i,
rv;
PLyPlanObject *plan;
- MemoryContext oldcontext;
+ volatile MemoryContext oldcontext;
if (list != NULL)
{
@@ -2579,7 +2579,7 @@ static PyObject *
PLy_spi_execute_query(char *query, long limit)
{
int rv;
- MemoryContext oldcontext;
+ volatile MemoryContext oldcontext;
oldcontext = CurrentMemoryContext;
PG_TRY();
@@ -2616,7 +2616,7 @@ static PyObject *
PLy_spi_execute_fetch_result(SPITupleTable *tuptable, int rows, int status)
{
PLyResultObject *result;
- MemoryContext oldcontext;
+ volatile MemoryContext oldcontext;
result = (PLyResultObject *) PLy_result_new();
Py_DECREF(result->status);
[parent: f9aa8763e293]