summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-02-18 23:50:06 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-02-18 23:50:06 +0000
commita232f30f05848830dad21c6786e0841ddad991fb (patch)
tree7ffd7d6a1fab1c5045c0e2453bc57ff56f8e3d33
parent858d1699f2be81e298bce72a217984c6618ca452 (diff)
downloadpostgresql-a232f30f05848830dad21c6786e0841ddad991fb.tar.gz
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.
-rw-r--r--src/pl/plpython/plpython.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index 37b8638a08..4bba81aceb 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.137 2010/02/14 18:42:19 rhaas Exp $
+ * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.138 2010/02/18 23:50:06 tgl Exp $
*
*********************************************************************
*/
@@ -2763,7 +2763,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)
@@ -2934,7 +2934,7 @@ PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit)
int i,
rv;
PLyPlanObject *plan;
- MemoryContext oldcontext;
+ volatile MemoryContext oldcontext;
if (list != NULL)
{
@@ -3081,7 +3081,7 @@ static PyObject *
PLy_spi_execute_query(char *query, long limit)
{
int rv;
- MemoryContext oldcontext;
+ volatile MemoryContext oldcontext;
oldcontext = CurrentMemoryContext;
PG_TRY();
@@ -3116,7 +3116,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);