summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-03 09:48:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-03 09:48:43 +0000
commit7e001f288baccb92e6ef266269baaefcc1255a3e (patch)
treedeeb2ca23fad37c3fd014e212d4530dbda08ce94 /compile.c
parent0886a02707a95d5d893d0a5de98cdce634cec7d1 (diff)
compile.c: omit unnecessary defined guard
* compile.c (defined_expr): omit unnecessary defined guard when method call has no receiver and no arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 23a85f8785..d8411055e0 100644
--- a/compile.c
+++ b/compile.c
@@ -3601,7 +3601,7 @@ defined_expr(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
(type == NODE_CALL ||
(type == NODE_ATTRASGN && !private_recv_p(node)));
- if (!lfinish[1]) {
+ if (!lfinish[1] && (node->nd_args || explicit_receiver)) {
lfinish[1] = NEW_LABEL(nd_line(node));
}
if (node->nd_args) {