pike.git/
src/
array.c
Branch:
Tag:
Non-build tags
All tags
No tags
2012-04-07
2012-04-07 19:48:48 by Henrik Grubbström (Grubba) <grubba@grubba.org>
186ab2bbc0ac26bae65a680975b952ce6c1bbd09 (
17
lines) (+
15
/-
2
)
[
Show
|
Annotate
]
Branch:
7.9
array: lfun_cmp() mustn't use LFUN_EQ if LFUN_GT and LFUN_LT are lacking.
932:
default_res = CMPFUN_UNORDERED; }
-
if ((fun = FIND_LFUN(p->inherits[SUBTYPEOF(*a)].prog, LFUN_EQ)) != -1) {
+
/* NB: It's not a good idea to use LFUN_EQ here
if
+
* there is neither LFUN_LT nor LFUN_GT, since
+
* the sorting order may get confused, which
+
* will cause merge_array_with_order
(
) to fail.
+
*/
+
if
(
(default_res == CMPFUN_UNORDERED) &&
+
(
fun = FIND_LFUN(p->inherits[SUBTYPEOF(*a)].prog, LFUN_EQ)) != -1) {
push_svalue(b); apply_low(a->u.object, fun + p->inherits[SUBTYPEOF(*a)].identifier_level, 1);
971:
default_res = CMPFUN_UNORDERED; }
-
if ((fun = FIND_LFUN(p->inherits[SUBTYPEOF(*b)].prog, LFUN_EQ)) != -1) {
+
/* NB: It's not a good idea to use LFUN_EQ here
if
+
* there is neither LFUN_LT nor LFUN_GT, since
+
* the sorting order may get confused, which
+
* will cause merge_array_with_order
(
) to fail.
+
*/
+
if
(
(default_res == CMPFUN_UNORDERED) &&
+
(
fun = FIND_LFUN(p->inherits[SUBTYPEOF(*b)].prog, LFUN_EQ)) != -1) {
push_svalue(a); apply_low(b->u.object, fun + p->inherits[SUBTYPEOF(*b)].identifier_level, 1);