Commit 60df7778 authored by kano4's avatar kano4

Add break to default case in switch statement

parent 08a0c9f3
...@@ -702,6 +702,7 @@ mrb_ary_aget(mrb_state *mrb, mrb_value self) ...@@ -702,6 +702,7 @@ mrb_ary_aget(mrb_state *mrb, mrb_value self)
default: default:
mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments"); mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments");
break;
} }
return mrb_nil_value(); /* dummy to avoid warning : not reach here */ return mrb_nil_value(); /* dummy to avoid warning : not reach here */
......
...@@ -408,6 +408,7 @@ mrb_get_args(mrb_state *mrb, const char *format, ...) ...@@ -408,6 +408,7 @@ mrb_get_args(mrb_state *mrb, const char *format, ...)
if (argc <= i && !opt) { if (argc <= i && !opt) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments"); mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments");
} }
break;
} }
switch (c) { switch (c) {
......
...@@ -379,6 +379,7 @@ dispatch(codegen_scope *s, int pc) ...@@ -379,6 +379,7 @@ dispatch(codegen_scope *s, int pc)
fprintf(stderr, "bug: dispatch on non JMP op\n"); fprintf(stderr, "bug: dispatch on non JMP op\n");
#endif #endif
scope_error(s); scope_error(s);
break;
} }
s->iseq[pc] = MKOP_AsBx(c, GETARG_A(i), diff); s->iseq[pc] = MKOP_AsBx(c, GETARG_A(i), diff);
} }
......
...@@ -518,6 +518,7 @@ mrb_obj_instance_eval(mrb_state *mrb, mrb_value self) ...@@ -518,6 +518,7 @@ mrb_obj_instance_eval(mrb_state *mrb, mrb_value self)
default: default:
cv = mrb_singleton_class(mrb, self); cv = mrb_singleton_class(mrb, self);
c = mrb_class_ptr(cv); c = mrb_class_ptr(cv);
break;
} }
return mrb_yield_internal(mrb, b, 0, 0, self, c); return mrb_yield_internal(mrb, b, 0, 0, self, c);
} }
...@@ -931,6 +932,7 @@ mrb_f_raise(mrb_state *mrb, mrb_value self) ...@@ -931,6 +932,7 @@ mrb_f_raise(mrb_state *mrb, mrb_value self)
exc = mrb_make_exception(mrb, argc, a); exc = mrb_make_exception(mrb, argc, a);
mrb_obj_iv_set(mrb, mrb_obj_ptr(exc), mrb_intern(mrb, "lastpc"), mrb_voidp_value(mrb->ci->pc)); mrb_obj_iv_set(mrb, mrb_obj_ptr(exc), mrb_intern(mrb, "lastpc"), mrb_voidp_value(mrb->ci->pc));
mrb_exc_raise(mrb, exc); mrb_exc_raise(mrb, exc);
break;
} }
return mrb_nil_value(); /* not reached */ return mrb_nil_value(); /* not reached */
} }
......
...@@ -240,6 +240,7 @@ is_special_global_name(const char* m) ...@@ -240,6 +240,7 @@ is_special_global_name(const char* m)
default: default:
if (!ISDIGIT(*m)) return FALSE; if (!ISDIGIT(*m)) return FALSE;
do ++m; while (ISDIGIT(*m)); do ++m; while (ISDIGIT(*m));
break;
} }
return !*m; return !*m;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment