summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-10-16 08:21:06 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2013-10-16 08:21:06 +0900
commit9b2f4c4423ed11f12d6393ae1f0dd4fe3e51ffa0 (patch)
treea460b9d51eac09de3146f959bf3d254fb7f8e168 /src
parentdef683ae72827a20b99ef1129dd59ea8f0c891dd (diff)
downloadmruby-9b2f4c4423ed11f12d6393ae1f0dd4fe3e51ffa0.tar.gz
mruby-9b2f4c4423ed11f12d6393ae1f0dd4fe3e51ffa0.zip
move declarations to the beginning of blocks
Diffstat (limited to 'src')
-rw-r--r--src/vm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vm.c b/src/vm.c
index 1cb2a83e9..a08565d55 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -701,8 +701,10 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
CASE(OP_GETCONST) {
/* A B R(A) := constget(Sym(B)) */
+ mrb_value val;
+
ERR_PC_HOOK(mrb, pc);
- mrb_value val = mrb_vm_const_get(mrb, syms[GETARG_Bx(i)]);
+ val = mrb_vm_const_get(mrb, syms[GETARG_Bx(i)]);
regs = mrb->c->stack;
regs[GETARG_A(i)] = val;
NEXT;
@@ -716,10 +718,11 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
CASE(OP_GETMCNST) {
/* A B C R(A) := R(C)::Sym(B) */
+ mrb_value val;
int a = GETARG_A(i);
ERR_PC_HOOK(mrb, pc);
- mrb_value val = mrb_const_get(mrb, regs[a], syms[GETARG_Bx(i)]);
+ val = mrb_const_get(mrb, regs[a], syms[GETARG_Bx(i)]);
regs = mrb->c->stack;
regs[a] = val;
NEXT;