From a6b1454a5d6a9d489e3ed70114e43a5d3a9467ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Thu, 11 Jun 2020 14:33:36 +0900 Subject: [PATCH] optimize_checktype: do not goto into a branch I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor. --- compile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compile.c b/compile.c index fd94d61552..51477e9e20 100644 --- a/compile.c +++ b/compile.c @@ -2746,7 +2746,6 @@ optimize_checktype(rb_iseq_t *iseq, INSN *iobj) if (!ciobj || !IS_INSN_ID(ciobj, checktype)) return FALSE; niobj = (INSN *)get_next_insn(ciobj); if (!niobj) { - no_branch: /* TODO: putobject true/false */ return FALSE; } @@ -2762,7 +2761,7 @@ optimize_checktype(rb_iseq_t *iseq, INSN *iobj) } break; default: - goto no_branch; + return FALSE; } line = ciobj->insn_info.line_no; if (!dest) {