projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version number changes. Find maths library for Maurer's test.
[u/mdw/catacomb]
/
mp-mem.c
diff --git
a/mp-mem.c
b/mp-mem.c
index
2f75365
..
833874d
100644
(file)
--- a/
mp-mem.c
+++ b/
mp-mem.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: mp-mem.c,v 1.
1 1999/11/17 18:02:16
mdw Exp $
+ * $Id: mp-mem.c,v 1.
2 1999/12/10 23:19:02
mdw Exp $
*
* Memory management for multiprecision numbers
*
*
* Memory management for multiprecision numbers
*
@@
-30,6
+30,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: mp-mem.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: mp-mem.c,v $
+ * Revision 1.2 1999/12/10 23:19:02 mdw
+ * Improve error-checking.
+ *
* Revision 1.1 1999/11/17 18:02:16 mdw
* New multiprecision integer arithmetic suite.
*
* Revision 1.1 1999/11/17 18:02:16 mdw
* New multiprecision integer arithmetic suite.
*
@@
-99,11
+102,12
@@
void mp_build(mp *m, mpw *v, mpw *vl)
void mp_destroy(mp *m)
{
void mp_destroy(mp *m)
{
- if (m->f & MP_CONST)
-
return
;
+ assert(((void)"Destroying a free integer", !(m->f & MP_DESTROYED)));
+
assert(((void)"Attempted to destroy a constant", !(m->f & MP_CONST)))
;
if (m->f & MP_BURN)
memset(m->v, 0, MPWS(m->sz));
MP_FREE(m->v);
if (m->f & MP_BURN)
memset(m->v, 0, MPWS(m->sz));
MP_FREE(m->v);
+ m->f |= MP_DESTROYED;
DESTROY(m);
}
DESTROY(m);
}