1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00

Mark variables modified in TRY block as volatile.

It's important that the values in these variables are maintained even after an exception is thrown, so they must be marked volatile.

Found while testing on the ppc64le architecture.
This commit is contained in:
David Steele 2020-05-08 15:36:20 -04:00
parent cdebfb09e0
commit 14369c1c3c

View File

@ -503,8 +503,8 @@ infoLoad(const String *error, InfoLoadCallback *callbackFunction, void *callback
MEM_CONTEXT_TEMP_BEGIN()
{
unsigned int try = 0;
bool done = false;
bool loaded = false;
volatile bool done = false; // Are all files tried? Must be preserved even on error.
volatile bool loaded = false; // Was a file loaded? Must be preserved even on error.
const ErrorType *loadErrorType = NULL;
String *loadErrorMessage = NULL;