summaryrefslogtreecommitdiff
path: root/insns.def
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2021-03-16 15:25:37 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2021-03-17 10:55:37 -0700
commitea817c60fcbdc2c4496be045f5bf028b702561ba (patch)
tree8b2ced0f5505268eeb2dd84d843b0301ae3ca959 /insns.def
parentc3971bea3351e014171910402a220770196ed1cc (diff)
Refactor vm_defined to return a boolean
We just need this function to return whether or not the thing we're looking for is defined. If it's defined, return something true, otherwise false.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4279
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def4
1 files changed, 1 insertions, 3 deletions
diff --git a/insns.def b/insns.def
index ca56416d23..1dc0bb3365 100644
--- a/insns.def
+++ b/insns.def
@@ -667,12 +667,10 @@ defined
(VALUE val)
// attr bool leaf = leafness_of_defined(op_type);
{
+ val = Qnil;
if (vm_defined(ec, GET_CFP(), op_type, obj, v)) {
val = needstr;
}
- else {
- val = Qnil;
- }
}
/* check `target' matches `pattern'.