pike.git/
src/
array.c
Branch:
Tag:
Non-build tags
All tags
No tags
2013-05-28
2013-05-28 17:22:19 by Martin Nilsson <nilsson@opera.com>
0a2cda9d87c48eeb8c43b2bb5b4a8cf5aaedb625 (
15
lines) (+
12
/-
3
)
[
Show
|
Annotate
]
Branch:
7.9
Fixed bugs found by dmalloc.
2053:
{ /* We only need to do anything if the value exists in the array. */ ssize_t off = fast_array_search( a, b, 0 );
+
TYPE_FIELD tmp;
if( off == -1 ) /* We still need to return a new array. */
2061:
/* In this case we generate a new array and modify that one. */ destructive = 0; from = (size_t)off;
+
tmp = a->type_field;
a = allocate_array_no_init(size-1,0);
-
+
a->type_field = tmp;
SET_ONERROR( ouch, do_free_array, a ); dp = ITEM(a);
2108:
} else /* b does not exist in the array. */ {
-
a
->refs++
;
+
add_ref(
a
)
;
return a; } #undef MATCH_COPY
2122:
if( !destructive ) UNSET_ONERROR( ouch ); else
-
a
->refs++
;
+
add_ref(
a
)
;
-
+
if( a->size )
return a;
-
+
+
free_array(a);
+
add_ref(&empty_array);
+
return &empty_array;
} /** Subtract an array from another.