Skip to content

Commit 09e5c5e

Browse files
authored
ZJIT: Name enum for bindgen (#14802)
Relying on having the same compiler version and behavior across platforms is brittle, as Kokubun points out. Instead, name the enum so we don't have to rely on gensym stability. Fix Shopify#787
1 parent d7f2a1e commit 09e5c5e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

zjit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ rb_zjit_print_exception(void)
235235
rb_warn("Ruby error: %"PRIsVALUE"", rb_funcall(exception, rb_intern("full_message"), 0));
236236
}
237237

238-
enum {
238+
enum zjit_exported_constants {
239239
RB_INVALID_SHAPE_ID = INVALID_SHAPE_ID,
240240
};
241241

zjit/bindgen/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ fn main() {
290290
.allowlist_function("rb_zjit_insn_leaf")
291291
.allowlist_type("robject_offsets")
292292
.allowlist_type("rstring_offsets")
293-
.allowlist_var("RB_INVALID_SHAPE_ID")
293+
.allowlist_type("zjit_exported_constants")
294294
.allowlist_function("rb_assert_holding_vm_lock")
295295
.allowlist_function("rb_jit_shape_too_complex_p")
296296
.allowlist_function("rb_jit_multi_ractor_p")

zjit/src/cruby_bindings.inc.rs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)