Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a232f30

Browse files
committed
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.
1 parent 858d169 commit a232f30

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/pl/plpython/plpython.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**********************************************************************
22
* plpython.c - python as a procedural language for PostgreSQL
33
*
4-
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.137 2010/02/14 18:42:19 rhaas Exp $
4+
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.138 2010/02/18 23:50:06 tgl Exp $
55
*
66
*********************************************************************
77
*/
@@ -2763,7 +2763,7 @@ PLy_spi_prepare(PyObject *self, PyObject *args)
27632763
PyObject *volatile optr = NULL;
27642764
char *query;
27652765
void *tmpplan;
2766-
MemoryContext oldcontext;
2766+
volatile MemoryContext oldcontext;
27672767

27682768
/* Can't execute more if we have an unhandled error */
27692769
if (PLy_error_in_progress)
@@ -2934,7 +2934,7 @@ PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit)
29342934
int i,
29352935
rv;
29362936
PLyPlanObject *plan;
2937-
MemoryContext oldcontext;
2937+
volatile MemoryContext oldcontext;
29382938

29392939
if (list != NULL)
29402940
{
@@ -3081,7 +3081,7 @@ static PyObject *
30813081
PLy_spi_execute_query(char *query, long limit)
30823082
{
30833083
int rv;
3084-
MemoryContext oldcontext;
3084+
volatile MemoryContext oldcontext;
30853085

30863086
oldcontext = CurrentMemoryContext;
30873087
PG_TRY();
@@ -3116,7 +3116,7 @@ static PyObject *
31163116
PLy_spi_execute_fetch_result(SPITupleTable *tuptable, int rows, int status)
31173117
{
31183118
PLyResultObject *result;
3119-
MemoryContext oldcontext;
3119+
volatile MemoryContext oldcontext;
31203120

31213121
result = (PLyResultObject *) PLy_result_new();
31223122
Py_DECREF(result->status);

0 commit comments

Comments
 (0)