fix sequence pop bug
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 8 Feb 2006 15:58:41 +0000 (15:58 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 8 Feb 2006 15:58:41 +0000 (15:58 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1525 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ltt/parser.c

index 785cb652aaf2a47e7771024817649956274c6f28..84a0b5f4d273517f6912f22a5129b8b93541921b 100644 (file)
@@ -1495,7 +1495,8 @@ void sequence_push(sequence_t *t, void *elem)
 
 void *sequence_pop(sequence_t *t) 
 {
-  return t->array[t->position--];
+       if(t->position == 0) printf("Error : trying to pop an empty sequence");
+  return t->array[--t->position];
 }
 
 
This page took 0.026804 seconds and 4 git commands to generate.