Skip to content

Commit e60e195

Browse files
authored
ZJIT: Fix Kernel#Float's annotation (ruby#14123)
As pointed out in ruby#14078 (comment), the return type should be `Float` instead.
1 parent fe3ed3e commit e60e195

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

zjit/src/cruby_methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ pub fn init() -> Annotations {
174174
annotate!(rb_cNilClass, "nil?", types::TrueClass, no_gc, leaf, elidable);
175175
annotate!(rb_mKernel, "nil?", types::FalseClass, no_gc, leaf, elidable);
176176

177-
annotate_builtin!(rb_mKernel, "Float", types::Flonum);
177+
annotate_builtin!(rb_mKernel, "Float", types::Float);
178178
annotate_builtin!(rb_mKernel, "Integer", types::Integer);
179179
annotate_builtin!(rb_mKernel, "class", types::Class, leaf);
180180

zjit/src/hir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5011,9 +5011,9 @@ mod tests {
50115011
assert_method_hir_with_opcode("Float", YARVINSN_opt_invokebuiltin_delegate_leave, expect![[r#"
50125012
fn Float@<internal:kernel>:
50135013
bb0(v0:BasicObject, v1:BasicObject, v2:BasicObject, v3:BasicObject):
5014-
v6:Flonum = InvokeBuiltin rb_f_float, v0, v1, v2
5014+
v6:Float = InvokeBuiltin rb_f_float, v0, v1, v2
50155015
Jump bb1(v0, v1, v2, v3, v6)
5016-
bb1(v8:BasicObject, v9:BasicObject, v10:BasicObject, v11:BasicObject, v12:Flonum):
5016+
bb1(v8:BasicObject, v9:BasicObject, v10:BasicObject, v11:BasicObject, v12:Float):
50175017
Return v12
50185018
"#]]);
50195019
}

0 commit comments

Comments
 (0)