leptris 1.9.335.0 → 1.9.336.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 225f8f82a406f4b33f6b79fd50ce6c2eef25df2d2aef61e6dc9548a6779a6caf
4
- data.tar.gz: b305d44e708d36fe4ccdec123bb34ad9ca37d450a7544c1cd564a56e75714602
3
+ metadata.gz: e4c62c67ac4f9ae3950cf00eddaf50348cf3aaf623f86a7d5962ed61f39b0a42
4
+ data.tar.gz: 023d10d1004e4c592f8c4becaa99bbf46ac6a997ffa013b727b281304d9dd9d6
5
5
  SHA512:
6
- metadata.gz: d6b4bb6218955e1ebf09f12a7c4561f723e5de446c9a6c600f660feda4af67d60f60a66cdfe9d37e9ba89d20e6608afb389edb189e20fcbc1c6eec4445269a53
7
- data.tar.gz: bb2157992d129be3dccafd79c95a66c99e2d5a9532f43faea8adf4430c9a89b38348fba0063d86dad2748c4f8051456ec0ff31b07a21e2759d491dbc8a2eab55
6
+ metadata.gz: 04ae4b5411227a6cf3c66b85f2f88afb51138e6c9b4d0cb1dd171ab06c6be8425b5526e411712d7b485eefae7e8d068cfcf7698f3c2a05c94f18bd3c4168256e
7
+ data.tar.gz: 462c5abd3145f642fda1fa8e763ce403e675f5290580ea31aac8b88f11fd116b33addf4442abdfe4a2dc13ef8196527dadbfb3127aa76ef3c159ff0111379220
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec)
8
8
  # Pin for `rake compile` and the platform-gem builds. Keep in lockstep
9
9
  # with .github/workflows/build.yml (which calls `rake compile`) and the
10
10
  # CHANGELOG when libleptris releases.
11
- LIBLEPTRIS_VERSION = "1.9.335"
11
+ LIBLEPTRIS_VERSION = "1.9.336"
12
12
  # Vendored alongside libleptris for fn:normalize-unicode (TODO
13
13
  # .restructure/20): built per platform with a RELOCATABLE @rpath
14
14
  # install name, loaded by ffi.rb before libleptris so the
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Leptris
4
- VERSION = "1.9.335.0"
4
+ VERSION = "1.9.336.0"
5
5
  end
data/vendor-src/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Sources vendored in this gem (recompile rights; the ruby
2
2
  variant builds them at install via extconf.rb):
3
3
 
4
- - libleptris v1.9.335
4
+ - libleptris v1.9.336
5
5
  - utf8proc v2.11.0
6
6
 
7
7
  Rebuild by hand:
@@ -1,5 +1,24 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.9.336] - 2026-10-10
4
+
5
+ ### Fixed
6
+
7
+ - **plan_result_build members emit in op order on every platform
8
+ (leptris#1625, PR #1629).** The serializer orders children by
9
+ byte position with an unstable qsort; builder-created values
10
+ carry no position, so the tie fell to unspecified libc behavior
11
+ and collection members reversed on Windows (both x64 and
12
+ arm64). Builder values now take a dense insertion rank before
13
+ push — fixing an off-by-one in the element branch besides — and
14
+ the comparator breaks position ties on it, making the order
15
+ total and platform-independent. Walk output is undisturbed (the
16
+ walk's own ranks are dense already). The binding's round-trip
17
+ spec can flip to strict member order once a release carries
18
+ this.
19
+
20
+
21
+
3
22
  ## [1.9.335] - 2026-10-10
4
23
 
5
24
  ### Fixed
@@ -3,7 +3,7 @@
3
3
  cmake_minimum_required(VERSION 3.20)
4
4
 
5
5
  project(leptris
6
- VERSION 1.9.335
6
+ VERSION 1.9.336
7
7
  DESCRIPTION "Fast XML parser and XPath evaluator in pure C"
8
8
  LANGUAGES C CXX
9
9
  )
@@ -1344,6 +1344,11 @@ static int dp_kid_pos_cmp(const void* a, const void* b) {
1344
1344
  (const struct leptris_plan_result* const*)b;
1345
1345
  if ((*ka)->position < (*kb)->position) return -1;
1346
1346
  if ((*ka)->position > (*kb)->position) return 1;
1347
+ /* #1625: position ties (builder nodes, offset-less rows) fall
1348
+ * to the dense insertion rank - qsort is not stable, and an
1349
+ * unspecified tie reordered members per platform libc. */
1350
+ if ((*ka)->order_index < (*kb)->order_index) return -1;
1351
+ if ((*ka)->order_index > (*kb)->order_index) return 1;
1347
1352
  return 0;
1348
1353
  }
1349
1354
 
@@ -1586,12 +1591,16 @@ LEPTRIS_API LeptrisPlanResult leptris_plan_result_build(
1586
1591
  return NULL;
1587
1592
  }
1588
1593
  root = v;
1589
- } else if (!dp_value_push(stack[sp - 1], v)) {
1590
- dp_result_free_rec(v);
1591
- goto oom;
1594
+ } else {
1595
+ /* rank BEFORE push (kid_count is post-increment) -
1596
+ * every value needs one: the serializer's qsort
1597
+ * breaks position ties on it (#1625) */
1598
+ v->order_index = (uint32_t)stack[sp - 1]->kid_count;
1599
+ if (!dp_value_push(stack[sp - 1], v)) {
1600
+ dp_result_free_rec(v);
1601
+ goto oom;
1602
+ }
1592
1603
  }
1593
- v->order_index = (uint32_t)
1594
- (sp == 0 ? 0 : stack[sp - 1]->kid_count);
1595
1604
  stack[sp++] = v;
1596
1605
  } else if (op->kind == LEPTRIS_PLAN_OP_SCALAR) {
1597
1606
  if (sp == 0) {
@@ -1609,6 +1618,7 @@ LEPTRIS_API LeptrisPlanResult leptris_plan_result_build(
1609
1618
  if (!dp_value_set_str(v, op->value ? op->value : "",
1610
1619
  op->value ? op->value_len : 0))
1611
1620
  dp_value_set_str(v, "", 0);
1621
+ v->order_index = (uint32_t)stack[sp - 1]->kid_count;
1612
1622
  if (!dp_value_push(stack[sp - 1], v)) {
1613
1623
  dp_result_free_rec(v);
1614
1624
  goto oom;
@@ -2163,15 +2163,21 @@ TEST(Plan408, ResultBuildFeedsSerialize) {
2163
2163
  leptris_plan_row_op ops[] = {
2164
2164
  {LEPTRIS_PLAN_OP_ELEMENT, 0, UINT32_MAX, NULL, NULL, 0},
2165
2165
  {LEPTRIS_PLAN_OP_ATTR, 0, UINT32_MAX, "id", "7", 1},
2166
- {LEPTRIS_PLAN_OP_SCALAR, 0, 0, NULL, "first", 5},
2166
+ {LEPTRIS_PLAN_OP_SCALAR, 0, 0, NULL, "alpha", 5},
2167
+ {LEPTRIS_PLAN_OP_SCALAR, 0, 0, NULL, "beta", 4},
2168
+ {LEPTRIS_PLAN_OP_SCALAR, 0, 0, NULL, "gamma", 5},
2167
2169
  {LEPTRIS_PLAN_OP_END, 0, UINT32_MAX, NULL, NULL, 0},
2168
2170
  };
2169
2171
  LeptrisPlanResult r =
2170
- leptris_plan_result_build(plan, ops, 4, &st);
2172
+ leptris_plan_result_build(plan, ops, 6, &st);
2171
2173
  ASSERT_NE(r, nullptr);
2172
2174
  char* out = leptris_plan_serialize(plan, r, &st);
2173
2175
  ASSERT_NE(out, nullptr);
2174
- EXPECT_STREQ(out, "<b id=\"7\"><p>first</p></b>");
2176
+ /* #1625: multi-member order is the OP order on every platform
2177
+ * (position ties fell to unstable qsort and reversed members
2178
+ * on Windows) */
2179
+ EXPECT_STREQ(out,
2180
+ "<b id=\"7\"><p>alpha</p><p>beta</p><p>gamma</p></b>");
2175
2181
  leptris_free_string(out);
2176
2182
  leptris_plan_result_free(r);
2177
2183
  leptris_plan_free(plan);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
3
3
  "name": "leptris",
4
- "version": "1.9.335",
4
+ "version": "1.9.336",
5
5
  "description": "High-performance XML parser and XPath 1.0 engine in C (libleptris)",
6
6
  "homepage": "https://github.com/leptris/leptris",
7
7
  "license": "MIT",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.335.0
4
+ version: 1.9.336.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.