aboutsummaryrefslogtreecommitdiff
path: root/src/Storage.c
diff options
context:
space:
mode:
authortradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364>2002-06-21 15:36:22 +0000
committertradke <tradke@b61c5cb5-eaca-4651-9a7a-d64986f99364>2002-06-21 15:36:22 +0000
commitaace0e55969a53c9c1e610e8effdae75bfdc0037 (patch)
tree8a8db4f86ba456d7de4abe74e0d6e7fda4cdea81 /src/Storage.c
parentc94d8cd974d9ce822bc4a7f0e5b644e28e77ad69 (diff)
Set the data pointer in the GH->data[] array to NULL when switching off storage
for a variable. This lets the code crash immediatly once you try to access such a variable without storage. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGH/trunk@389 b61c5cb5-eaca-4651-9a7a-d64986f99364
Diffstat (limited to 'src/Storage.c')
-rw-r--r--src/Storage.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/Storage.c b/src/Storage.c
index 63d9186..d4b249d 100644
--- a/src/Storage.c
+++ b/src/Storage.c
@@ -760,15 +760,15 @@ static int PUGH_EnableGArrayGroupStorage (pGH *pughGH,
padding_size,
padding_address_spacing);
- ((cGH *) pughGH->callerid)->data[var][level] = GA->data;
-
nnostorage++;
}
else
{
- ((cGH *) pughGH->callerid)->data[var][level] = GA->data;
nstorage++;
}
+
+ /* set the variable's data pointer in the cGH structure */
+ ((cGH *) pughGH->callerid)->data[var][level] = GA->data;
}
}
@@ -1385,13 +1385,10 @@ static int PUGHi_EnableGArrayGroupStorage (pGH *pughGH,
padding_address_spacing);
}
- ((cGH *) pughGH->callerid)->data[var][level] = GA->data;
-
nnostorage++;
}
else
{
- ((cGH *) pughGH->callerid)->data[var][level] = GA->data;
nstorage++;
/* Count the number of timelevels which were previously allocated. */
@@ -1400,6 +1397,9 @@ static int PUGHi_EnableGArrayGroupStorage (pGH *pughGH,
retval++;
}
}
+
+ /* set the variable's data pointer in the cGH structure */
+ ((cGH *) pughGH->callerid)->data[var][level] = GA->data;
}
}
@@ -1488,14 +1488,15 @@ static int PUGHi_DisableGArrayGroupStorage (pGH *pughGH,
PUGH_DisableGArrayDataStorage (GA);
}
- ((cGH *) pughGH->callerid)->data[var][level] = GA->data;
nstorage++;
}
else
{
- ((cGH *) pughGH->callerid)->data[var][level] = GA->data;
nnostorage++;
}
+
+ /* set the variable's data pointer in the cGH structure */
+ ((cGH *) pughGH->callerid)->data[var][level] = NULL;
}
}
@@ -1669,6 +1670,9 @@ 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;
}
}