aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-02-18 23:50:41 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-02-18 23:50:41 +0000
commit7925085e61897f2d966f38b0db4a2c9a0024f266 (patch)
tree2b5de016d18ffca85afaa96f640ef9666f576648
parente2a2990759612bd53611608b2cc57e0b02f2dced (diff)
downloadpostgresql-7925085e61897f2d966f38b0db4a2c9a0024f266.tar.gz
postgresql-7925085e61897f2d966f38b0db4a2c9a0024f266.zip
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 c9f1ee5f270..a6c65f1b7ba 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -29,7 +29,7 @@
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.58.4.9 2009/11/03 07:53:58 petere Exp $
+ * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.58.4.10 2010/02/18 23:50:41 tgl Exp $
*
*********************************************************************
*/
@@ -1853,7 +1853,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)
@@ -2007,7 +2007,7 @@ PLy_spi_execute_plan(PyObject * ob, PyObject * list, int limit)
int i,
rv;
PLyPlanObject *plan;
- MemoryContext oldcontext;
+ volatile MemoryContext oldcontext;
if (list != NULL)
{
@@ -2151,7 +2151,7 @@ static PyObject *
PLy_spi_execute_query(char *query, int limit)
{
int rv;
- MemoryContext oldcontext;
+ volatile MemoryContext oldcontext;
oldcontext = CurrentMemoryContext;
PG_TRY();
@@ -2188,7 +2188,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);