diff options
author | tradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2002-07-01 15:19:33 +0000 |
---|---|---|
committer | tradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364> | 2002-07-01 15:19:33 +0000 |
commit | e55042ea7847cd24ea89fd162c30e2c09f12b846 (patch) | |
tree | a8a29a7c73e573b916d3c21ad6f2463acf869c43 | |
parent | 895fb4bca1d52884b8a34854d30129b96c849d68 (diff) |
Fixed bug in NULL pointer assignment when switching off storage for scalar variables.
This closes PR CactusPUGH/1114.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@393 b61c5cb5-eaca-4651-9a7a-d64986f99364
-rw-r--r-- | src/Storage.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Storage.c b/src/Storage.c index b70755b..210b1d2 100644 --- a/src/Storage.c +++ b/src/Storage.c @@ -745,7 +745,7 @@ static int PUGH_EnableGArrayGroupStorage (pGH *pughGH, { GA = (pGA *) pughGH->variables[var][level]; - if (! GA->storage) + if (GA->storage == PUGH_NOSTORAGE) { #ifdef DEBUG_PUGH printf (" PUGH_EnableGArrayGroupStorage: request for var '%s' " @@ -1366,7 +1366,7 @@ static int PUGHi_EnableGArrayGroupStorage (pGH *pughGH, { GA = (pGA *) pughGH->variables[var][level]; - if (! GA->storage) + if (GA->storage == PUGH_NOSTORAGE) { if(level < n_timelevels) @@ -1470,7 +1470,7 @@ static int PUGHi_DisableGArrayGroupStorage (pGH *pughGH, { GA = (pGA *) pughGH->variables[var][level]; - if (GA->storage) + if (GA->storage == PUGH_STORAGE) { /* Count the number of timelevels which were previously allocated. */ if(var == first_var) @@ -1669,7 +1669,7 @@ static int PUGHi_DisableScalarGroupStorage (pGH *pughGH, ((char *) temp)[vtypesize] = PUGH_NOSTORAGE; /* set the variable's data pointer in the cGH structure */ - ((cGH *) pughGH->callerid)->data[variable][level] = NULL; + ((cGH *) pughGH->callerid)->data[variable+first_var][level] = NULL; } } } @@ -1822,7 +1822,7 @@ static int PUGHi_NumTimeLevelsArray(const pGH *pughGH, int var, int timelevels) { GA = (pGA *) pughGH->variables[var][level]; - if (GA->storage) + if (GA->storage == PUGH_STORAGE) { retval++; } |