summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/mrbconf.h1
-rw-r--r--mrblib/array.rb2
-rw-r--r--src/parse.y2
-rw-r--r--src/vm.c8
4 files changed, 9 insertions, 4 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index 42ff4b80c..12be661f7 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -127,6 +127,7 @@ typedef short mrb_sym;
# define snprintf _snprintf
# define isnan _isnan
# define isinf(n) (!_finite(n) && !_isnan(n))
+# define strtoll _strtoi64
#endif
#endif /* MRUBYCONF_H */
diff --git a/mrblib/array.rb b/mrblib/array.rb
index 881f22df7..50f851fd2 100644
--- a/mrblib/array.rb
+++ b/mrblib/array.rb
@@ -20,7 +20,7 @@ class Array
##
# Calls the given block for each element of +self+
- # and pass the index of the respective elment.
+ # and pass the index of the respective element.
#
# ISO 15.2.12.5.11
def each_index(&block)
diff --git a/src/parse.y b/src/parse.y
index 7ecdbab85..369634e0c 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -3075,7 +3075,7 @@ nextc(parser_state *p)
return -1;
}
else {
- c = *p->s++;
+ c = (unsigned char)*p->s++;
}
if (c == '\n') {
// must understand heredoc
diff --git a/src/vm.c b/src/vm.c
index fc251d3cb..da6700bdf 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -1153,8 +1153,11 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
L_RAISE:
mrb_obj_iv_ifnone(mrb, mrb->exc, mrb_intern(mrb, "lastpc"), mrb_voidp_value(pc));
ci = mrb->ci;
- eidx = mrb->ci->eidx;
- if (ci == mrb->cibase) goto L_STOP;
+ eidx = ci->eidx;
+ if (ci == mrb->cibase) {
+ if (ci->ridx == 0) goto L_STOP;
+ goto L_RESCUE;
+ }
while (ci[0].ridx == ci[-1].ridx) {
cipop(mrb);
ci = mrb->ci;
@@ -1173,6 +1176,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
break;
}
}
+ L_RESCUE:
irep = ci->proc->body.irep;
pool = irep->pool;
syms = irep->syms;