Skip to content

Commit c363723

Browse files
committed
woah, buggy! look at that send, it's completely wrong!
1 parent 276f4ce commit c363723

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

zjit/src/hir.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4187,6 +4187,29 @@ mod tests {
41874187
Return v10
41884188
"#]]);
41894189
}
4190+
4191+
#[test]
4192+
fn dupn() {
4193+
eval("
4194+
def test(x) = (x[0, 1] ||= 0)
4195+
");
4196+
assert_method_hir_with_opcode("test", YARVINSN_dupn, expect![[r#"
4197+
fn test:
4198+
bb0(v0:BasicObject, v1:BasicObject):
4199+
v3:NilClassExact = Const Value(nil)
4200+
v4:Fixnum[0] = Const Value(0)
4201+
v5:Fixnum[1] = Const Value(1)
4202+
v7:BasicObject = SendWithoutBlock v5, :[], v5, v5
4203+
v8:CBool = Test v7
4204+
IfTrue v8, bb1(v0, v1, v3, v1, v4, v5, v7)
4205+
v10:Fixnum[0] = Const Value(0)
4206+
v12:BasicObject = SendWithoutBlock v1, :[]=, v4, v5, v10
4207+
Return v10
4208+
bb1(v14:BasicObject, v15:BasicObject, v16:NilClassExact, v17:BasicObject, v18:Fixnum[0], v19:Fixnum[1], v20:BasicObject):
4209+
Return v20
4210+
"#]]);
4211+
4212+
}
41904213
}
41914214

41924215
#[cfg(test)]

0 commit comments

Comments
 (0)