Skip to content
Snippets Groups Projects
  1. Aug 11, 2020
    • Tobias S. Josefowitz's avatar
      Array: array_search() may not change needle's type · 83ac4caa
      Tobias S. Josefowitz authored
      If the needle supplied to array_search() was a destructed object,
      array_search() would convert it to (PIKE_T_INT,NUMBER_DESTRUCTED)-type 0
      in-place.
      
      Since array_search() is sometimes called with the needle residing in
      another array - for example when ORing arrays - this would introduce
      PIKE_T_INT items into such arrays without reflecting this in said
      array's type_field.
      
      If the type_field would then later on (still) only have BIT_OBJECT set,
      we would call free_object() on the thus introduced PIKE_T_INT when
      freeing array items, leading straight to a segmentation fault.
      83ac4caa
  2. Mar 19, 2019
  3. Jun 11, 2015
  4. Jun 03, 2015
  5. Mar 23, 2015
  6. Oct 02, 2014
    • Per Hedbor's avatar
      Optimized case for array += ({..}) when refs==2. · eeaea163
      Per Hedbor authored
      This was sort of done before, but it first assigned the lvalue
      to 0, then assigned it back to the array once done.
      
      This new version is about 2x faster, improving the "append array"
      benchmark by about 60%.
      eeaea163
  7. Sep 03, 2014
  8. Aug 22, 2014
  9. Aug 14, 2014
  10. Jul 14, 2014
  11. Jun 18, 2014
  12. Jun 17, 2014
  13. May 06, 2014
  14. Apr 27, 2014
  15. Jan 12, 2014
  16. Dec 14, 2013
  17. Nov 03, 2013
  18. Jun 11, 2013
  19. May 28, 2013
  20. May 25, 2013
    • Per Hedbor's avatar
      Optimized array*str when the array only contains one element. · 3402a638
      Per Hedbor authored
      It now simply returns the array element (if it is a string, that is).
      3402a638
    • Per Hedbor's avatar
      Changed ordo of array-({item}) from O(n log n) to O(n). · e3d39ae2
      Per Hedbor authored
      This especially helps when you have arrays with objects with `< and
      `== operator overloading, where the constant is also changed
      dramatically.
      
      Also, it is now enough to have == operator overloading to get - to
      work (given that there is at most one object in the array getting
      items removed.)
      e3d39ae2
    • Per Hedbor's avatar
      Changed worst-case ordo of replace(array,item1,item2) from O(n^2) to O(n). · 45df9023
      Per Hedbor authored
      Replace uses search_array, which in turn calls
      check_array_for_destruct.  So, if you had an array where all elements
      were replaced by the replace containing at least one object replace()
      was O(n^2), not O(n).
      
      In general check_array_for_destruct is rather unneeded, since the
      comparison functions already checks for destructed objects, but I
      guess that it might cause objects to be free:d slightly sooner.
      45df9023
  21. Apr 11, 2013
    • Arne Goedeke's avatar
      array implode: fixed buffer overrun · 9e760528
      Arne Goedeke authored
      When using array implode with zero elements it was possible to write the delimiter
      into the newly created string too many times, resulting in a buffer overrun.
      This bug has been introduced by commit 2f27ebab.
      9e760528
  22. Feb 25, 2013
  23. Apr 07, 2012
  24. Nov 05, 2011
  25. Oct 28, 2011
  26. Jul 22, 2011
  27. May 02, 2011
  28. Apr 02, 2011
  29. Mar 06, 2011
  30. Nov 05, 2010
  31. Oct 16, 2010
Loading