summaryrefslogtreecommitdiff
path: root/jit.c
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2025-10-19 15:11:39 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2025-10-21 16:48:45 -0400
commit35c2230734e65e8ab55aa718ca6ea02ca9622984 (patch)
treeffb88afff2f7bb787d467d571aa0163a48fbc988 /jit.c
parent193b299b8d1b09de9de695f6fd88314ccfbf884b (diff)
ZJIT: Fix binding to `INVALID_SHAPE_ID` under `-std=c99 -pedantic`
``` /src/jit.c:19:5: error: ISO C restricts enumerator values to range of 'int' (4294967295 is too large) [-Werror,-Wpedantic] 19 | RB_INVALID_SHAPE_ID = INVALID_SHAPE_ID, | ^ ~~~~~~~~~~~~~~~~ ```
Diffstat (limited to 'jit.c')
-rw-r--r--jit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/jit.c b/jit.c
index b7cb05d1c3..db3fe097ef 100644
--- a/jit.c
+++ b/jit.c
@@ -22,6 +22,11 @@ enum robject_offsets {
ROBJECT_OFFSET_AS_ARY = offsetof(struct RObject, as.ary),
};
+// Manually bound in rust since this is out-of-range of `int`,
+// so this can't be in a `enum`, and we avoid `static const`
+// to avoid allocating storage for the constant.
+const shape_id_t rb_invalid_shape_id = INVALID_SHAPE_ID;
+
unsigned int
rb_iseq_encoded_size(const rb_iseq_t *iseq)
{