add fiber assertion from #1865 patch

parent 9201af7d
......@@ -3,6 +3,8 @@
#include "mruby/class.h"
#include "mruby/proc.h"
#define fiber_ptr(o) ((struct RFiber*)mrb_ptr(o))
#define FIBER_STACK_INIT_SIZE 64
#define FIBER_CI_INIT_SIZE 8
......@@ -62,7 +64,7 @@ static mrb_value
fiber_init(mrb_state *mrb, mrb_value self)
{
static const struct mrb_context mrb_context_zero = { 0 };
struct RFiber *f = (struct RFiber*)mrb_ptr(self);
struct RFiber *f = fiber_ptr(self);
struct mrb_context *c;
struct RProc *p;
mrb_callinfo *ci;
......@@ -114,8 +116,9 @@ fiber_init(mrb_state *mrb, mrb_value self)
static struct mrb_context*
fiber_check(mrb_state *mrb, mrb_value fib)
{
struct RFiber *f = (struct RFiber*)mrb_ptr(fib);
struct RFiber *f = fiber_ptr(fib);
mrb_assert(f->tt == MRB_TT_FIBER);
if (!f->cxt) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "uninitialized Fiber");
}
......
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