diff options
| author | Max Bernstein <ruby@bernsteinbear.com> | 2025-07-11 10:57:38 -0400 |
|---|---|---|
| committer | Max Bernstein <tekknolagi@gmail.com> | 2025-07-11 12:30:46 -0400 |
| commit | 0d7d87b40f79c10016b27d608892ebbe069295eb (patch) | |
| tree | 51c192c17c87336b3f283b2a25e8374e87b60e01 | |
| parent | e3456d61802f4817a632a496b08e571fd3083c20 (diff) | |
ZJIT: Gracefully handle iseq_name with NULL ISEQ
| -rw-r--r-- | zjit/src/cruby.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/zjit/src/cruby.rs b/zjit/src/cruby.rs index eba8af318f..2557e2e913 100644 --- a/zjit/src/cruby.rs +++ b/zjit/src/cruby.rs @@ -701,6 +701,9 @@ pub fn cstr_to_rust_string(c_char_ptr: *const c_char) -> Option<String> { } pub fn iseq_name(iseq: IseqPtr) -> String { + if iseq.is_null() { + return "<NULL>".to_string(); + } let iseq_label = unsafe { rb_iseq_label(iseq) }; if iseq_label == Qnil { "None".to_string() |
