|
|
|
@ -482,14 +482,14 @@ static int ink_consume_one(int* end, struct context* pContext, char* r, int is_s |
|
|
|
int it = 0; |
|
|
|
new_protected_array(pContext); |
|
|
|
if(routine->top < 1) { |
|
|
|
pContext->panic = -1; |
|
|
|
pContext->panic = -35482; |
|
|
|
return -8746; |
|
|
|
} |
|
|
|
value = routine->stack[routine->top - 1]; |
|
|
|
ary = ink_get_value(pContext, value); |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(ary == NULL) { |
|
|
|
pContext->panic = -1; |
|
|
|
pContext->panic = -13546; |
|
|
|
return -8747; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -587,7 +587,7 @@ static int ink_consume_one(int* end, struct context* pContext, char* r, int is_s |
|
|
|
if (!done) { |
|
|
|
i = ink_add_lex_string(pContext, r); |
|
|
|
if(i < 0) { |
|
|
|
pContext->panic = mi">1; |
|
|
|
pContext->panic = o">-3247; |
|
|
|
return -7; |
|
|
|
} |
|
|
|
value.value = i; |
|
|
|
@ -628,7 +628,9 @@ static int ink_lex(struct context *pContext, const char* buffer) { |
|
|
|
if(*(buffer+1) == 0 || isspace(*(buffer+1))) { |
|
|
|
err = ink_consume_one(&end, pContext, r, 1); |
|
|
|
if(err < 0) { |
|
|
|
pContext->panic = 1; |
|
|
|
if(!pContext->panic) { |
|
|
|
pContext->panic = -324; |
|
|
|
} |
|
|
|
return -995; |
|
|
|
} |
|
|
|
parses_string = 0; |
|
|
|
@ -664,7 +666,7 @@ static int ink_lex(struct context *pContext, const char* buffer) { |
|
|
|
/* Send the token off to the wizard (ink_parse) */ |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(err < 0) { |
|
|
|
pContext->panic = 1; |
|
|
|
pContext->panic = o">-121; |
|
|
|
return -8; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -683,7 +685,7 @@ static int ink_lex(struct context *pContext, const char* buffer) { |
|
|
|
err = ink_consume_one(&end, pContext, r, 0); |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(err < 0) { |
|
|
|
pContext->panic = mi">1; |
|
|
|
pContext->panic = o">-3458; |
|
|
|
return -9; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1117,7 +1119,9 @@ int ink_compile(struct context *pContext, const char* buffer) { |
|
|
|
currentRoutine->parse_error.offset = -1; |
|
|
|
} |
|
|
|
#endif |
|
|
|
pContext->panic = 1; |
|
|
|
if(!pContext->panic) { |
|
|
|
pContext->panic = -2824; |
|
|
|
} |
|
|
|
return -1; |
|
|
|
} |
|
|
|
executable_buffer_top = 0; |
|
|
|
@ -1130,7 +1134,7 @@ int ink_compile(struct context *pContext, const char* buffer) { |
|
|
|
currentRoutine->parse_error.offset = -1; |
|
|
|
} |
|
|
|
#endif |
|
|
|
pContext->panic = 1; |
|
|
|
pContext->panic = o">-2188; |
|
|
|
return -1; |
|
|
|
} |
|
|
|
if(executable_buffer_top != 0) { |
|
|
|
@ -1149,7 +1153,7 @@ int ink_compile(struct context *pContext, const char* buffer) { |
|
|
|
currentRoutine->parse_error.offset = -1; |
|
|
|
} |
|
|
|
#endif |
|
|
|
pContext->panic = 1; |
|
|
|
pContext->panic = o">-2114; |
|
|
|
return -1; |
|
|
|
} |
|
|
|
frame.executing.type = INK_FUNCTION; |
|
|
|
@ -1163,7 +1167,7 @@ int ink_compile(struct context *pContext, const char* buffer) { |
|
|
|
currentRoutine->parse_error.error_message = "Could not push any executable frame: push failed"; |
|
|
|
currentRoutine->parse_error.offset = -1; |
|
|
|
} |
|
|
|
pContext->panic = 1; |
|
|
|
pContext->panic = o">-1752; |
|
|
|
return -1; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1552,7 +1556,7 @@ static void add_int(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -312; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1560,7 +1564,7 @@ static void add_int(struct context* ctx) { |
|
|
|
b = currentRoutine->stack[currentRoutine->top-2]; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(!(a.type == INK_INTEGER && b.type == INK_INTEGER)) { |
|
|
|
ctx->panic = mi">1; |
|
|
|
ctx->panic = o">-684; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1575,7 +1579,7 @@ static void sub_int(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -2581; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1583,7 +1587,7 @@ static void sub_int(struct context* ctx) { |
|
|
|
b = currentRoutine->stack[currentRoutine->top-2]; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(!(a.type == INK_INTEGER && b.type == INK_INTEGER)) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -821; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1598,7 +1602,7 @@ static void mult_int(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -8533; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1606,7 +1610,7 @@ static void mult_int(struct context* ctx) { |
|
|
|
b = currentRoutine->stack[currentRoutine->top-2]; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(!(a.type == INK_INTEGER && b.type == INK_INTEGER)) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -543; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1621,7 +1625,7 @@ static void div_int(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -84; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1629,7 +1633,7 @@ static void div_int(struct context* ctx) { |
|
|
|
b = currentRoutine->stack[currentRoutine->top-2]; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(!(a.type == INK_INTEGER && b.type == INK_INTEGER)) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -1328; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1645,7 +1649,7 @@ static void is_equal(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -13587; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1666,7 +1670,7 @@ static void is_different(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -3873; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1688,7 +1692,7 @@ static void rem_int(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -218; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1696,7 +1700,7 @@ static void rem_int(struct context* ctx) { |
|
|
|
b = currentRoutine->stack[currentRoutine->top-2]; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(!(a.type == INK_INTEGER && b.type == INK_INTEGER)) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -8321; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1711,7 +1715,7 @@ static void xor_int(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -184; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1719,7 +1723,7 @@ static void xor_int(struct context* ctx) { |
|
|
|
b = currentRoutine->stack[currentRoutine->top-2]; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(!(a.type == INK_INTEGER && b.type == INK_INTEGER)) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -183; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1734,7 +1738,7 @@ static void gt_int(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -132; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1742,7 +1746,7 @@ static void gt_int(struct context* ctx) { |
|
|
|
b = currentRoutine->stack[currentRoutine->top-2]; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(!(a.type == INK_INTEGER && b.type == INK_INTEGER)) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -1185; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1757,7 +1761,7 @@ static void gte_int(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -138; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1765,7 +1769,7 @@ static void gte_int(struct context* ctx) { |
|
|
|
b = currentRoutine->stack[currentRoutine->top-2]; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(!(a.type == INK_INTEGER && b.type == INK_INTEGER)) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -172; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1780,7 +1784,7 @@ static void lte_int(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -116; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1788,7 +1792,7 @@ static void lte_int(struct context* ctx) { |
|
|
|
b = currentRoutine->stack[currentRoutine->top-2]; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(!(a.type == INK_INTEGER && b.type == INK_INTEGER)) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -171; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1805,7 +1809,7 @@ static void lt_int(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -135; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1813,7 +1817,7 @@ static void lt_int(struct context* ctx) { |
|
|
|
b = currentRoutine->stack[currentRoutine->top-2]; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(!(a.type == INK_INTEGER && b.type == INK_INTEGER)) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -1187; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1832,14 +1836,14 @@ static void dupe_elem(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 1) { |
|
|
|
ctx->panic = mi">1; |
|
|
|
ctx->panic = o">-2488; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
a = currentRoutine->stack[currentRoutine->top-1]; |
|
|
|
err = ink_push(ctx, a); |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(err < 0) ctx->panic = mi">1; |
|
|
|
if(err < 0) ctx->panic = o">-348; |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
@ -1848,7 +1852,7 @@ static void drop_elem(struct context* ctx) { |
|
|
|
struct ink_routine* currentRoutine; |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
if(currentRoutine->top < 1) { |
|
|
|
ctx->panic = 1; |
|
|
|
ctx->panic = o">-1835; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1867,28 +1871,28 @@ static void pluck_elem(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 1) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -1454; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
a = currentRoutine->stack[currentRoutine->top-1]; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(a.type != INK_INTEGER) { |
|
|
|
ctx->panic = 1; |
|
|
|
ctx->panic = o">-175; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
position = currentRoutine->top - (a.value + 1); |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(position >= currentRoutine->top || position < 0) { |
|
|
|
ctx->panic = 1; |
|
|
|
ctx->panic = o">-721; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
ink_pop(ctx); |
|
|
|
err = ink_push(ctx, currentRoutine->stack[position]); |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(err < 0) ctx->panic = mi">1; |
|
|
|
if(err < 0) ctx->panic = o">-7965; |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
@ -1899,7 +1903,7 @@ static void swap_elem(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -11354; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1915,14 +1919,14 @@ static void return_if(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 1) { |
|
|
|
ctx->panic = -1; |
|
|
|
ctx->panic = -348; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
a = currentRoutine->stack[currentRoutine->top-1]; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(a.type != INK_INTEGER) { |
|
|
|
ctx->panic = 1; |
|
|
|
ctx->panic = o">-124; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1941,7 +1945,7 @@ static void jump_if(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2) { |
|
|
|
ctx->panic = -1; |
|
|
|
ctx->panic = -751; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1949,7 +1953,7 @@ static void jump_if(struct context* ctx) { |
|
|
|
condition = currentRoutine->stack[currentRoutine->top-2]; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(label.type != INK_INTEGER || condition.type != INK_INTEGER) { |
|
|
|
ctx->panic = -1; |
|
|
|
ctx->panic = -126; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1971,7 +1975,7 @@ static void print_int(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 1 || currentRoutine->stack[currentRoutine->top-1].type != INK_INTEGER) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -13544; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -1998,7 +2002,7 @@ static void print_as_utf8(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 1 || currentRoutine->stack[currentRoutine->top-1].type != INK_INTEGER) { |
|
|
|
ctx->panic = -1; |
|
|
|
ctx->panic = -1185; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -2018,7 +2022,7 @@ static void print_as_utf8(struct context* ctx) { |
|
|
|
ctx->putchar(ctx, ((a.value & 0xFC0) >> 6) | 128); |
|
|
|
ctx->putchar(ctx, (a.value & 0x3F) | 128); |
|
|
|
} else { |
|
|
|
ctx->panic = -1; |
|
|
|
ctx->panic = -9472; |
|
|
|
return; |
|
|
|
} |
|
|
|
ink_pop(ctx); |
|
|
|
@ -2188,7 +2192,7 @@ int array_push_s(struct context* ctx, struct ink_array* ary, struct elem value) |
|
|
|
|
|
|
|
void array_push(struct context* ctx, struct ink_routine* currentRoutine, struct ink_array* ary, struct elem value) { |
|
|
|
if(array_push_s(ctx, ary, value)) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -156; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -2203,15 +2207,15 @@ static void push_array(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 2 || currentRoutine->stack[currentRoutine->top-1].type != tid) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -197; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
a = currentRoutine->stack[currentRoutine->top-1]; |
|
|
|
ary= ink_get_value(ctx, a); |
|
|
|
ary = ink_get_value(ctx, a); |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(ary == NULL) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -137; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -2229,7 +2233,7 @@ static void push_delimited_array(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(currentRoutine->top < 1) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -1456; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -2286,7 +2290,7 @@ static void index_array(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if (currentRoutine->top < 2 || currentRoutine->stack[currentRoutine->top - 1].type != tid || currentRoutine->stack[currentRoutine->top - 2].type != INK_INTEGER) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -173; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -2294,7 +2298,7 @@ static void index_array(struct context* ctx) { |
|
|
|
ary = ink_get_value(ctx, a); |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if (ary == NULL) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -1787; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -2305,7 +2309,7 @@ static void index_array(struct context* ctx) { |
|
|
|
|
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(ary->top <= idx.value) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -1375; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -2327,7 +2331,7 @@ static void set_array(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if (currentRoutine->top < 3 || currentRoutine->stack[currentRoutine->top - 1].type != tid || currentRoutine->stack[currentRoutine->top - 2].type != INK_INTEGER) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -1787; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -2335,7 +2339,7 @@ static void set_array(struct context* ctx) { |
|
|
|
ary = ink_get_value(ctx, a); |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if (ary == NULL) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -1732; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -2345,7 +2349,7 @@ static void set_array(struct context* ctx) { |
|
|
|
|
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if(ary->top <= idx.value) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -1232; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -2370,7 +2374,7 @@ static void get_size_array(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if (currentRoutine->top < 1 || currentRoutine->stack[currentRoutine->top - 1].type != tid) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -17657; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -2378,7 +2382,7 @@ static void get_size_array(struct context* ctx) { |
|
|
|
ary = ink_get_value(ctx, a); |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if (ary == NULL) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -13783; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -2399,7 +2403,7 @@ static void is_array(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if (currentRoutine->top < 1) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -1783; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -2423,7 +2427,7 @@ static void print_array_of_codepoints(struct context* ctx) { |
|
|
|
currentRoutine = ctx->routines + ctx->routine_current; |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
if (currentRoutine->top < 1 || currentRoutine->stack[currentRoutine->top - 1].type != tid) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -1378; |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
@ -2433,7 +2437,7 @@ static void print_array_of_codepoints(struct context* ctx) { |
|
|
|
#ifndef NOEXTRACHECKS |
|
|
|
for(i = 0; i < ary->top; ++i) { |
|
|
|
if(ary->elements[i].type != INK_INTEGER) { |
|
|
|
currentRoutine->panic = -1; |
|
|
|
currentRoutine->panic = -11234; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|