summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-04-25 14:36:17 +0900
committerGitHub <[email protected]>2021-04-25 14:36:17 +0900
commit767577efb1c98ae73c9803a5b049a3d4f1e652f7 (patch)
tree42990f51ba172d1f973890e9a33636120bddc480
parent4d249c28d9b736882ea26fd1494199733d4df68e (diff)
parentb18fd23cefac6f94a0d3b565a2e012c95dea2486 (diff)
downloadmruby-767577efb1c98ae73c9803a5b049a3d4f1e652f7.tar.gz
mruby-767577efb1c98ae73c9803a5b049a3d4f1e652f7.zip
Merge pull request #5422 from dearblue/binding1
Avoid ill-advised `goto`
-rw-r--r--mrbgems/mruby-binding-core/src/binding-core.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/mrbgems/mruby-binding-core/src/binding-core.c b/mrbgems/mruby-binding-core/src/binding-core.c
index 209da8bf9..1454f5945 100644
--- a/mrbgems/mruby-binding-core/src/binding-core.c
+++ b/mrbgems/mruby-binding-core/src/binding-core.c
@@ -188,10 +188,8 @@ binding_source_location(mrb_state *mrb, mrb_value self)
if (!proc || MRB_PROC_CFUNC_P(proc) ||
!proc->upper || MRB_PROC_CFUNC_P(proc->upper)) {
srcloc = mrb_nil_value();
- goto cache_source_location;
}
-
- {
+ else {
const mrb_irep *irep = proc->upper->body.irep;
mrb_int pc = binding_extract_pc(mrb, self);
if (pc < 0) {
@@ -210,7 +208,6 @@ binding_source_location(mrb_state *mrb, mrb_value self)
}
}
-cache_source_location:
if (!mrb_frozen_p(mrb_obj_ptr(self))) {
mrb_iv_set(mrb, self, MRB_SYM(source_location), srcloc);
}