Skip to content
Snippets Groups Projects
  1. Apr 03, 2018
  2. Mar 29, 2018
  3. Mar 17, 2018
    • Arseny Kapoulkine's avatar
      docs: Update changelog · cec32da2
      Arseny Kapoulkine authored
      Mention ubsan fixes; these fixes probably fix compact mode on some
      64-bit architecture where unaligned pointer reads aren't valid as well
      but it's probably not very relevant...
      cec32da2
    • Arseny Kapoulkine's avatar
      tests: Fix PUGIXML_COMPACT+PUGIXML_WCHAR_MODE tests · fe7b8378
      Arseny Kapoulkine authored
      Several tests got the buffer size wrong when sizeof(char_t)>1, and one
      test didn't meet the carefully tuned allocation criteria under compact
      mode due to the hash table usage and had to be changed a bit.
      fe7b8378
    • Arseny Kapoulkine's avatar
      ubsan: Fix undefined behavior for signed left shift in compact mode · e50672cf
      Arseny Kapoulkine authored
      We were using << compact_alignment_log2 instead of * compact_alignment
      for symmetry with the encoding where >> is crucial to keep code fast and
      round to negative infinity.
      
      For decoding, the results are the same and any reasonable compiler
      should convert *4 into <<2 so just use a multiplication - that doesn't
      trigger UB on negative numbers.
      e50672cf
  4. Mar 16, 2018
  5. Mar 13, 2018
  6. Mar 03, 2018
  7. Mar 02, 2018
  8. Feb 27, 2018
  9. Feb 22, 2018
    • Arseny Kapoulkine's avatar
      Work around gcc issues with limits.h not defining LLONG_MIN · 2ec3579f
      Arseny Kapoulkine authored
      It looks like there are several cases where this might happen:
      
      - In some MinGW distributions, the LLONG_MIN/etc defines are guarded
      with:
      
      	#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
      
      Which means that you don't get them in strict ANSI mode. The previous
      workaround was specifically targeted towards this.
      
      - In some GCC distributions (notably GCC 6.3.0 in some configurations),
      LLONG_MIN/etc. defines are guarded with:
      
      	#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
      
      But __STDC_VERSION__ isn't defined as C99 even if you use -std=c++14 -
      which is probably technically valid, but not useful.
      
      To work around this, redefine the symbols whenever we are building with
      GCC and we need them and they aren't defined - doing this is better than
      not building. Instead of hard-coding the constants, use GCC-specific
      __LONG_LONG_MAX__ to compute them.
      
      Fixes #181.
      2ec3579f
  10. Jan 29, 2018
  11. Jan 23, 2018
  12. Jan 08, 2018
  13. Dec 30, 2017
  14. Dec 22, 2017
  15. Nov 14, 2017
  16. Nov 13, 2017
    • Arseny Kapoulkine's avatar
      Merge pull request #170 from zeux/move · 7c6d0010
      Arseny Kapoulkine authored
      This change implements move ctor and assign support for xml_document.
      
      All node handles remain valid after the move and point to the new document; the only exception is the document node itself (that remains unmoved).
      
      Move is O(document size) in theory because it needs to relocate immediate document children (there is just one in conformant documents) and all memory pages; in practice the memory pages only need the header adjusted, which is ~0.1% of the actual data size.
      
      Move requires no allocations in general, except when using compact mode where some moves need to grow the hash table which can fail (throw).
      
      Fixes #104
      7c6d0010
    • Arseny Kapoulkine's avatar
      Fix -Wshadow warning · 3860b507
      Arseny Kapoulkine authored
      3860b507
    • Arseny Kapoulkine's avatar
      tests: Add compact move tests · 58611c87
      Arseny Kapoulkine authored
      This helps make sure our error handling logic works and is exercised.
      58611c87
    • Arseny Kapoulkine's avatar
      Implement correct move error handling for compact mode · 4bd8771c
      Arseny Kapoulkine authored
      In compact mode, we currently can not support zero-allocation moves
      since some pointer assignments required during the move need to allocate
      hash table slots.
      
      This is mostly applicable to xml_document_struct::first_child, since the
      pointer to this element is used as a hash table key, but there are some
      contrived cases where parents of root's children need a hash slot and
      didn't have it before.
      
      These cases can be fixed by changing the compact encoding to be a bit
      more move friendly, but for now it's easier to handle the error and
      throw/return during move.
      
      When this happens, the source document doesn't change.
      4bd8771c
    • Arseny Kapoulkine's avatar
      Add count argument to compact_hash_table::rehash/reserve · 91a3c288
      Arseny Kapoulkine authored
      This allows us to do a single reserve for a known amount of assignments
      that is larger than the default minimum per reserve (16).
      91a3c288
    • Arseny Kapoulkine's avatar
      CMake: Add __declspec(dllexport) for shared library builds · 6016e218
      Arseny Kapoulkine authored
      This makes sure that MSVC shared library build actually exports all the
      needed symbols and generates import table.
      
      Somehow, this is actually enough to make pugixml link as a DLL - there's
      no need to specify __declspec(dllimport) even though pugixml exports
      classes via DLL.
      
      Fixes #113.
      6016e218
  17. Nov 11, 2017
  18. Oct 30, 2017
    • Arseny Kapoulkine's avatar
      build: Simplify config=sanitize · 6fe31d14
      Arseny Kapoulkine authored
      These days OSX clang supports UB sanitizer so we can just use the same
      settings for all systems.
      6fe31d14
    • Arseny Kapoulkine's avatar
      build: Switch fuzz builds to use Clang 5.0 sanitize=fuzzer · ba950432
      Arseny Kapoulkine authored
      The old fuzzer location is deprecated; this also makes it almost trivial
      to fuzz, provided that the clang is set up correctly... on Ubuntu 17.10,
      a command sequence like this works now:
      
          sudo apt install clang-5.0
          sudo apt install libfuzzer-5.0
          sudo cp /usr/lib/llvm-5.0/lib/libFuzzer.a /usr/lib/libLLVMFuzzer.a
          CXX=clang++-5.0 make fuzz_parse
      ba950432
Loading