teptris 0.3.24.0-powerpc64le-linux → 0.3.26.0-powerpc64le-linux

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: f7d8f33163f1a4f5a14f30eae9cbb0d7dccafda624a5598b6758b236777d4eac
4
- data.tar.gz: 9342c50ba67092aa86435fad2f6097b824a8b7c440d189f78332ae7c669f3aff
3
+ metadata.gz: 5346cf995edd1796d1ea9f11b384749a35a0f7272c903ac348d5d0989483a367
4
+ data.tar.gz: b526faa83fd100be39d1830afd5aa60bc5100f4de36695e122b82478785754b8
5
5
  SHA512:
6
- metadata.gz: d0d9cafaef83698aa37c8c9695ba8087fdcd273e7680ede400c34db7ba21c23347f0ec3dc8c9822312d3cda71aa09ae804da91b94c248d728c5c445814acc497
7
- data.tar.gz: 28cb008e1c76813ff27e9a0eeb969566e49bb20d1da7f08907f311c997282ed91877dbe6cc0fd5cf129b4d0b6334ed3694924d58110378687e413444431fd81e
6
+ metadata.gz: 88cbada10a75aae6c20d50ff5a1b7d2205f029294b9f070689bf872ddc7ba9e49f756c2479d2d1a2c68016b20bc1f73c38ae47f2031ad8633045a8c64c2bf96c
7
+ data.tar.gz: 29eb154d9f00ce080354b4d783dfb9de5245ee1f257e530f5111acd64c8fa69aefce09670d22043cf1caa7307f7a479ed51aa56e706918ed772498372413a7fd
@@ -1,4 +1,4 @@
1
- # libteptris 0.3.24 — vendored source
1
+ # libteptris 0.3.26 — vendored source
2
2
 
3
3
  This directory carries the COMPLETE C source of the engine this
4
4
  gem's extension was built from (the packaging doctrine: compiled
@@ -3,7 +3,7 @@
3
3
 
4
4
  #define TEPTRIS_VERSION_MAJOR 0
5
5
  #define TEPTRIS_VERSION_MINOR 3
6
- #define TEPTRIS_VERSION_PATCH 24
7
- #define TEPTRIS_VERSION_STRING "0.3.24"
6
+ #define TEPTRIS_VERSION_PATCH 26
7
+ #define TEPTRIS_VERSION_STRING "0.3.26"
8
8
 
9
9
  #endif /* TEPTRIS_VERSION_H */
@@ -186,9 +186,13 @@ static const char *jstring(jctx *c, size_t *out_len) {
186
186
  return s;
187
187
  }
188
188
  /* escaped string: rebuild into arena memory, carrying the plain
189
- * prefix the fast scan already stepped over */
189
+ * prefix the fast scan already stepped over. Every remaining
190
+ * input byte yields at most one output byte (plain chars are
191
+ * 1:1, escapes consume >=2 input per <=4 output), so the whole
192
+ * remaining span is the tight bound — sizing from the prefix
193
+ * alone overflows on a long plain tail (ASan, nightly 2026-11-06). */
190
194
  size_t plain_len = c->pos - start;
191
- size_t cap = (c->pos - start) * 4 + 16;
195
+ size_t cap = (c->len - start) + 16;
192
196
  char *out = teptris_arena_alloc(c->a, cap);
193
197
  size_t n = plain_len;
194
198
  memcpy(out, c->src + start, plain_len);
@@ -1151,8 +1151,12 @@ sch_node *sch_compile_node(sctx *c, const jv *v) {
1151
1151
  }
1152
1152
  n->dynamic_recursive = recursive;
1153
1153
  } else if (strcmp(k, "contentSchema") == 0) {
1154
- n->content_schema = sch_compile_node(c, val);
1155
- if (n->content_schema == NULL && c->err[0] != '\0') return NULL;
1154
+ if (!c->dialect_declared) {
1155
+ n->content_schema = sch_compile_node(c, val);
1156
+ if (n->content_schema == NULL && c->err[0] != '\0') return NULL;
1157
+ }
1158
+ /* annotation under an explicit dialect (2020-12 content
1159
+ * vocabulary: assertions SHOULD NOT be made) */
1156
1160
  } else if (strcmp(k, "required") == 0 &&
1157
1161
  jv_kind_of(val) == JV_ARRAY) {
1158
1162
  size_t cnt = jv_item_count(val);
@@ -1224,10 +1228,10 @@ sch_node *sch_compile_node(sctx *c, const jv *v) {
1224
1228
  }
1225
1229
  } else if (strcmp(k, "contentEncoding") == 0 &&
1226
1230
  jv_kind_of(val) == JV_STRING) {
1227
- n->content_encoding = jv_str(val);
1231
+ if (!c->dialect_declared) n->content_encoding = jv_str(val);
1228
1232
  } else if (strcmp(k, "contentMediaType") == 0 &&
1229
1233
  jv_kind_of(val) == JV_STRING) {
1230
- n->content_media_type = jv_str(val);
1234
+ if (!c->dialect_declared) n->content_media_type = jv_str(val);
1231
1235
  } else if (strcmp(k, "items") == 0 && jv_kind_of(val) == JV_ARRAY) {
1232
1236
  /* draft-07 tuple form: positional prefixes; the union
1233
1237
  * reads them exactly like prefixItems, with
@@ -1300,7 +1304,11 @@ sch_node *sch_compile_node(sctx *c, const jv *v) {
1300
1304
  if (!count_value(c, val, &n->max_length)) return NULL;
1301
1305
  n->has_max_length = true;
1302
1306
  } else if (strcmp(k, "format") == 0 && jv_kind_of(val) == JV_STRING) {
1303
- n->format = format_kind(jv_str(val));
1307
+ if (!c->dialect_declared) {
1308
+ n->format = format_kind(jv_str(val));
1309
+ }
1310
+ /* an explicit dialect keeps the spec's annotation-only
1311
+ * default: the keyword rides the ignored tail */
1304
1312
  } else if ((strcmp(k, "minimum") == 0 || strcmp(k, "maximum") == 0 ||
1305
1313
  strcmp(k, "exclusiveMinimum") == 0 ||
1306
1314
  strcmp(k, "exclusiveMaximum") == 0) &&
@@ -1511,7 +1519,11 @@ static teptris_status schema_compile_core(const char *json, size_t len,
1511
1519
  c.cur_dir = held;
1512
1520
  }
1513
1521
  /* draft 07 and older make a $ref ignore its siblings; 2019-09+
1514
- * evaluate $ref alongside them. The root's $schema decides. */
1522
+ * evaluate $ref alongside them. The root's $schema decides. A
1523
+ * standard draft dialect switches format/content* to the spec's
1524
+ * annotation-only default; the format-assertion dialect URI opts
1525
+ * back in, and the no-dialect default asserts (the practical
1526
+ * mode every real-world manifest relies on). */
1515
1527
  if (jv_kind_of(root) == JV_OBJECT) {
1516
1528
  jv *sv = jv_member_get(root, "$schema");
1517
1529
  if (sv != NULL && jv_kind_of(sv) == JV_STRING) {
@@ -1520,6 +1532,9 @@ static teptris_status schema_compile_core(const char *json, size_t len,
1520
1532
  strstr(s, "draft-07") != NULL) {
1521
1533
  c.ref_exclusive = true;
1522
1534
  }
1535
+ if (strstr(s, "format-assertion") == NULL) {
1536
+ c.dialect_declared = true;
1537
+ }
1523
1538
  }
1524
1539
  }
1525
1540
 
@@ -226,6 +226,10 @@ typedef struct {
226
226
  /* which standard vocabularies the dialect keeps (8.1.2: a custom
227
227
  * metaschema's $vocabulary decides; absent = all of them) */
228
228
  unsigned vocab_mask;
229
+ /* an explicit root $schema declares the dialect: format and
230
+ * content* then follow the spec's annotation-only default. No
231
+ * $schema means teptris's practical default: assert. */
232
+ bool dialect_declared;
229
233
  /* standard vocabulary gates (the core vocabulary is mandatory and
230
234
  * never gated) */
231
235
  #define TEPTRIS_VOC_APPLICATOR 1u
Binary file
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Teptris
4
- VERSION = "0.3.24.0"
4
+ VERSION = "0.3.26.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teptris
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.24.0
4
+ version: 0.3.26.0
5
5
  platform: powerpc64le-linux
6
6
  authors:
7
7
  - teptris contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-04 00:00:00.000000000 Z
11
+ date: 2026-11-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A native C extension over libteptris, a C99 TOML 1.1 parser/emitter.
14
14
  API shape mirrors the tomlib gem.