summaryrefslogtreecommitdiffhomepage
path: root/src/codegen.c
diff options
context:
space:
mode:
authorCremno <[email protected]>2013-02-18 11:40:53 +0100
committerCremno <[email protected]>2013-02-18 11:40:53 +0100
commit2942ad8eeb10291caaa83852d1b426a06ed84d20 (patch)
tree4a4957efad2af283e81fc513dceceeafab38524c /src/codegen.c
parente4bebad82d0e4b5c98d767d3606d7f2f3edce0ab (diff)
downloadmruby-2942ad8eeb10291caaa83852d1b426a06ed84d20.tar.gz
mruby-2942ad8eeb10291caaa83852d1b426a06ed84d20.zip
vars must be declared at the start of a block
Diffstat (limited to 'src/codegen.c')
-rw-r--r--src/codegen.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/codegen.c b/src/codegen.c
index 86cb5eb87..8cb571a28 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -1918,12 +1918,12 @@ codegen(codegen_scope *s, node *tree, int val)
int ai = mrb_gc_arena_save(s->mrb);
struct RClass* c = mrb_class_get(s->mrb, REGEXP_CLASS);
mrb_value args[2];
+ int off;
+
args[0] = mrb_str_new(s->mrb, p1, strlen(p1));
// TODO: Some regexp implementation does not have second argument
- //args[1] = mrb_str_new(s->mrb, p2, strlen(p2));
- int off = new_lit(s,
- mrb_class_new_instance(s->mrb, 1, args, c));
-
+ //args[1] = mrb_str_new(s->mrb, p2, strlen(p2))
+ off = new_lit(s, mrb_class_new_instance(s->mrb, 1, args, c));
mrb_gc_arena_restore(s->mrb, ai);
genop(s, MKOP_ABx(OP_LOADL, cursp(), off));
push();