From 2ab7c5306da3a122002c499afbcb7d78b5070fd4 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 31 May 2012 06:50:22 +0000 Subject: [PATCH] vm.c: UNREACHABLE to suppress warnings * vm.c (frame_info_{line_no,name,basename,filename,filepath}): add UNREACHABLE to suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/vm.c b/vm.c index 7e5e39bce6..2ca8e62537 100644 --- a/vm.c +++ b/vm.c @@ -848,6 +848,7 @@ frame_info_line_no(rb_frame_info_t *fi) return 0; default: rb_bug("frame_info_line_no: unreachable"); + UNREACHABLE; } } @@ -861,7 +862,7 @@ static VALUE frame_info_name(rb_frame_info_t *fi) { switch (fi->type) { - case FRAME_INFO_TYPE_ISEQ: + case FRAME_INFO_TYPE_ISEQ: case FRAME_INFO_TYPE_ISEQ_CALCED: return fi->body.iseq.iseq->location.name; case FRAME_INFO_TYPE_CFUNC: @@ -869,6 +870,7 @@ frame_info_name(rb_frame_info_t *fi) case FRAME_INFO_TYPE_IFUNC: default: rb_bug("frame_info_name: unreachable"); + UNREACHABLE; } } @@ -882,7 +884,7 @@ static VALUE frame_info_basename(rb_frame_info_t *fi) { switch (fi->type) { - case FRAME_INFO_TYPE_ISEQ: + case FRAME_INFO_TYPE_ISEQ: case FRAME_INFO_TYPE_ISEQ_CALCED: return fi->body.iseq.iseq->location.basename; case FRAME_INFO_TYPE_CFUNC: @@ -890,7 +892,8 @@ frame_info_basename(rb_frame_info_t *fi) case FRAME_INFO_TYPE_IFUNC: default: rb_bug("frame_info_basename: unreachable"); - } + UNREACHABLE; + } } static VALUE @@ -903,7 +906,7 @@ static VALUE frame_info_filename(rb_frame_info_t *fi) { switch (fi->type) { - case FRAME_INFO_TYPE_ISEQ: + case FRAME_INFO_TYPE_ISEQ: case FRAME_INFO_TYPE_ISEQ_CALCED: return fi->body.iseq.iseq->location.filename; case FRAME_INFO_TYPE_CFUNC: @@ -914,6 +917,7 @@ frame_info_filename(rb_frame_info_t *fi) case FRAME_INFO_TYPE_IFUNC: default: rb_bug("frame_info_filename: unreachable"); + UNREACHABLE; } } @@ -927,7 +931,7 @@ static VALUE frame_info_filepath(rb_frame_info_t *fi) { switch (fi->type) { - case FRAME_INFO_TYPE_ISEQ: + case FRAME_INFO_TYPE_ISEQ: case FRAME_INFO_TYPE_ISEQ_CALCED: return fi->body.iseq.iseq->location.filepath; case FRAME_INFO_TYPE_CFUNC: @@ -938,6 +942,7 @@ frame_info_filepath(rb_frame_info_t *fi) case FRAME_INFO_TYPE_IFUNC: default: rb_bug("frame_info_filepath: unreachable"); + UNREACHABLE; } }