Skip to content
Snippets Groups Projects
  1. Jun 15, 2017
  2. Apr 04, 2017
    • Arseny Kapoulkine's avatar
      Work around -fsanitize=integer issues · 38edf255
      Arseny Kapoulkine authored
      Integer sanitizer is flagging unsigned integer overflow in several
      functions in pugixml; unsigned integer overflow is well defined but it
      may not necessarily be intended.
      
      Apart from hash functions, both string_to_integer and integer_to_string
      use unsigned overflow - string_to_integer uses it to perform
      two-complement negation so that the bulk of the operation can run using
      unsigned integers. This makes it possible to simplify overflow checking.
      Similarly integer_to_string negates the number before generating a
      decimal representation, but negating is impossible without unsigned
      overflow or special-casing certain integer limits.
      
      For now just silence the integer overflow using a special attribute;
      also move unsigned overflow into string_to_integer from get_value_* so
      that we have fewer functions marked with the attribute.
      
      Fixes #133.
      38edf255
    • Arseny Kapoulkine's avatar
      Move libFuzzer build to Makefile · 24d1a456
      Arseny Kapoulkine authored
      Now the only thing fuzz_setup.sh does is installing new clang; if system
      clang supports -fsanitize-coverage then fuzz_setup.sh is not required.
      24d1a456
    • Arseny Kapoulkine's avatar
      tests: Fix fuzz_setup.sh · 0eb1ddb9
      Arseny Kapoulkine authored
      The script only worked if clang folder was already created.
      0eb1ddb9
  3. Mar 22, 2017
  4. Mar 21, 2017
  5. Mar 06, 2017
  6. Mar 05, 2017
  7. Mar 03, 2017
    • Arseny Kapoulkine's avatar
      Simplify compact_hash_table implementation · 8ce4592e
      Arseny Kapoulkine authored
      Instead of a separate implementation for find/insert, use just one that
      can do both. This reduces the code size and simplifies code coverage;
      the resulting code is close to what we had in terms of performance and
      since hash table is a fall back should not affect any real workloads.
      8ce4592e
  8. Feb 11, 2017
  9. Feb 09, 2017
  10. Feb 08, 2017
  11. Feb 07, 2017
    • Arseny Kapoulkine's avatar
      XPath: Simplify sorting implementation · 2162a0d8
      Arseny Kapoulkine authored
      Instead of a complicated partitioning scheme that tries to maintain the
      equal area in the middle, use a scheme where we keep the equal area in
      the left part of the array and then move it to the middle.
      
      Since generally sorted arrays don't contain many duplicates this extra
      copy is not too expensive, and it significantly simplifies the logic and
      maintains good complexity for sorting arrays with many equal elements
      nonetheless (unlike Hoare partitioning).
      
      Instead of a median of 9 just use a median of 3 - it performs pretty
      much identically on some internal performance tests, despite having a
      bit more comparisons in some cases.
      
      Finally, change the insertion sort threshold to 16 elements since that
      appears to have slightly better performance.
      2162a0d8
    • Arseny Kapoulkine's avatar
      XPath: Optimize insertion_sort · 774d5fe9
      Arseny Kapoulkine authored
      The previous implementation opted for doing two comparisons per element
      in the sorted case in order to remove one iterator bounds check per
      moved element when we actually need to copy. In our case however the
      comparator is pretty expensive (except for remove_duplicates which is
      fast as it is) so an extra object comparison hurts much more than an
      iterator comparison saves.
      
      This makes sorting by document order up to 3% faster for random
      sequences.
      774d5fe9
  12. Feb 06, 2017
  13. Feb 04, 2017
  14. Feb 03, 2017
    • Arseny Kapoulkine's avatar
      XPath: Clean up out-of-memory parse error handling · 33159924
      Arseny Kapoulkine authored
      Instead of relying on a specific string in the parse result, use
      allocator error state to report the error and then convert it to a
      string if necessary.
      
      We currently have to manually trigger the OOM error in two places
      because we use global allocator in rare cases; we don't really need to
      do this so this will be cleaned up later.
      33159924
  15. Feb 02, 2017
Loading