summaryrefslogtreecommitdiff
path: root/src/pl
diff options
context:
space:
mode:
authorTom Lane2010-02-18 23:50:12 +0000
committerTom Lane2010-02-18 23:50:12 +0000
commitd1b9b0c5632595dec59093fa6231705c0efeda99 (patch)
tree09015f3380be1478f6e5f3f3e10ad8acb5179537 /src/pl
parenta8d1624431c656289d1359511970c269930b2912 (diff)
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.
Diffstat (limited to 'src/pl')
-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 7db8369c61f..25e4d2653d3 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.122.2.1 2009/11/03 08:59:16 petere Exp $
+ * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.122.2.2 2010/02/18 23:50:12 tgl Exp $
*
*********************************************************************
*/
@@ -2340,7 +2340,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)
@@ -2508,7 +2508,7 @@ PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit)
int i,
rv;
PLyPlanObject *plan;
- MemoryContext oldcontext;
+ volatile MemoryContext oldcontext;
if (list != NULL)
{
@@ -2656,7 +2656,7 @@ static PyObject *
PLy_spi_execute_query(char *query, long limit)
{
int rv;
- MemoryContext oldcontext;
+ volatile MemoryContext oldcontext;
oldcontext = CurrentMemoryContext;
PG_TRY();
@@ -2693,7 +2693,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);