|
|
@ -1491,6 +1491,10 @@ void ink_gc(struct context* ctx) { |
|
|
|
|
|
|
|
/**********************************************************************************************************************/ |
|
|
|
|
|
|
|
#ifdef NUKE_PUTCHAR_MACRO |
|
|
|
#undef putchar |
|
|
|
#endif |
|
|
|
|
|
|
|
static void print_stacktrace(struct context* _) { |
|
|
|
int i; |
|
|
|
struct ink_routine* currentRoutine; |
|
|
@ -2033,6 +2037,25 @@ static void clear_stack(struct context* ctx) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void is_int(struct context* ctx) { |
|
|
|
struct ink_routine *currentRoutine; |
|
|
|
struct elem a; |
|
|
|
|
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if (currentRoutine->top < 1) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
a.type = INK_INTEGER; |
|
|
|
a.value = currentRoutine->stack[currentRoutine->top - 1].type == INK_INTEGER; |
|
|
|
ink_pop(ctx); |
|
|
|
|
|
|
|
ink_push(ctx, a); |
|
|
|
} |
|
|
|
|
|
|
|
static void dump_stack(struct context* ctx) { |
|
|
|
struct ink_routine* currentRoutine; |
|
|
|
int index; |
|
|
@ -2373,24 +2396,6 @@ static void is_array(struct context* ctx) { |
|
|
|
ink_push(ctx, a); |
|
|
|
} |
|
|
|
|
|
|
|
static void is_int(struct context* ctx) { |
|
|
|
struct ink_routine *currentRoutine; |
|
|
|
struct elem a; |
|
|
|
|
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if (currentRoutine->top < 1) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
a.type = INK_INTEGER; |
|
|
|
a.value = currentRoutine->stack[currentRoutine->top - 1].type == INK_INTEGER; |
|
|
|
ink_pop(ctx); |
|
|
|
|
|
|
|
ink_push(ctx, a); |
|
|
|
} |
|
|
|
|
|
|
|
static void print_array_of_codepoints(struct context* ctx) { |
|
|
|
int i; |
|
|
|
struct ink_routine *currentRoutine; |
|
|
|