]> granicus.if.org Git - postgresql/commitdiff
Volatile-ize all five places where we expect a PG_TRY block to restore
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 18 Feb 2010 23:50:20 +0000 (23:50 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 18 Feb 2010 23:50:20 +0000 (23:50 +0000)
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

index dffb1e3d68968080ff08e6daeac4528103117d2a..aa6ac71cb1ef402f58af1d96a714ca8f2b3f7c9b 100644 (file)
@@ -1,7 +1,7 @@
 /**********************************************************************
  * plpython.c - python as a procedural language for PostgreSQL
  *
- *     $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.106.2.1 2009/11/03 08:44:52 petere Exp $
+ *     $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.106.2.2 2010/02/18 23:50:20 tgl Exp $
  *
  *********************************************************************
  */
@@ -2292,7 +2292,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)
@@ -2457,7 +2457,7 @@ PLy_spi_execute_plan(PyObject * ob, PyObject * list, long limit)
        int                     i,
                                rv;
        PLyPlanObject *plan;
-       MemoryContext oldcontext;
+       volatile MemoryContext oldcontext;
 
        if (list != NULL)
        {
@@ -2605,7 +2605,7 @@ static PyObject *
 PLy_spi_execute_query(char *query, long limit)
 {
        int                     rv;
-       MemoryContext oldcontext;
+       volatile MemoryContext oldcontext;
 
        oldcontext = CurrentMemoryContext;
        PG_TRY();
@@ -2642,7 +2642,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);