Skip to content

Commit 4eadf03

Browse files
committed
ZJIT: Check special_const_p() before using rb_obj_shape_id()
It only works with heap objects.
1 parent 55f2a8d commit 4eadf03

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

zjit/src/cruby.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,11 @@ impl VALUE {
565565
}
566566

567567
pub fn shape_id_of(self) -> ShapeId {
568-
ShapeId(unsafe { rb_obj_shape_id(self) })
568+
if self.special_const_p() {
569+
INVALID_SHAPE_ID
570+
} else {
571+
ShapeId(unsafe { rb_obj_shape_id(self) })
572+
}
569573
}
570574

571575
pub fn embedded_p(self) -> bool {

0 commit comments

Comments
 (0)