CLONE -eval module: incorrect inserting of values into stack with
eval_insert_value
-----------------------------------------------------------------------------------
Key: SER-431
URL: http://tracker.iptel.org/browse/SER-431
Project: SER
Issue Type: Bug
Affects Versions: 2.0
Environment: Debian Sarge
Assigned To: Tomas Mandys
Fix For: 2.0
When using eval_insert_value for inserting values into an empty stack it
behaves correct, the counter is inserted first and then the values in order.
But when using eval_insert_value on a non-empty stack the elements are inserted
in the wrong order (see example).
This behavior is because of the "pivot" pointer which is NULL for an empty
stack, but points to the element with index 0 for a non-empty stack. And since
this pointer is not updated after inserting an item eval_insert_value is using
the same "pivot" element for all items (and the counter).
Example:
-----------
eval_insert_value("One, Two");
eval_dump();
eval_insert_value("Three, Four");
eval_dump();
Stack (no=3):
# 00 s:'Two', cnt:1
# 01 s:'One', cnt:1
# 02 i:2
#-01 i:2
#-02 s:'One', cnt:1
#-03 s:'Two', cnt:1
Stack (no=6):
# 00 i:2
# 01 s:'Three', cnt:1
# 02 s:'Four', cnt:1
# 03 s:'Two', cnt:1
# 04 s:'One', cnt:1
# 05 i:2
#-01 i:2
#-02 s:'One', cnt:1
#-03 s:'Two', cnt:1
#-04 s:'Four', cnt:1
#-05 s:'Three', cnt:1
#-06 i:2
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.iptel.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
Serdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/serdev