A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Gasp ! A bug in the extract function ! Shame on me !
[simgrid.git]
/
src
/
xbt
/
swag.c
diff --git
a/src/xbt/swag.c
b/src/xbt/swag.c
index
42ae4ef
..
dc09977
100644
(file)
--- a/
src/xbt/swag.c
+++ b/
src/xbt/swag.c
@@
-59,6
+59,10
@@
void *xbt_swag_extract(void *obj, xbt_swag_t swag)
if (!obj)
return NULL;
if (!obj)
return NULL;
+ if(!xbt_swag_belongs(obj, swag)) /* Trying to remove an object that
+ was not in this swag */
+ return NULL;
+
if (swag->head == swag->tail) { /* special case */
if (swag->head != obj) /* Trying to remove an object that was not in this swag */
return NULL;
if (swag->head == swag->tail) { /* special case */
if (swag->head != obj) /* Trying to remove an object that was not in this swag */
return NULL;