|
@ -807,22 +807,26 @@ void ink_compile(struct context *pContext, const char* buffer) { |
|
|
pContext->panic = 1; |
|
|
pContext->panic = 1; |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
integer = ink_itoa(pContext, routine); |
|
|
|
|
|
integer_size = strlen(integer); |
|
|
|
|
|
memcpy(main_fn+10, integer, integer_size); |
|
|
|
|
|
pContext->free(integer); |
|
|
|
|
|
main_fn[10+integer_size] = 0; |
|
|
|
|
|
frame.executing.value = ink_add_indigenous(pContext, main_fn, executable_buffer, executable_buffer_top); |
|
|
|
|
|
if(frame.executing.value < 0) { |
|
|
|
|
|
pContext->panic = 1; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
frame.executing.type = INK_FUNCTION; |
|
|
|
|
|
frame.index = 0; |
|
|
|
|
|
err = ink_push_fn(pContext, frame); |
|
|
|
|
|
if(err < 0) { |
|
|
|
|
|
pContext->panic = 1; |
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
if(executable_buffer_top != 0) { |
|
|
|
|
|
integer = ink_itoa(pContext, routine); |
|
|
|
|
|
integer_size = strlen(integer); |
|
|
|
|
|
memcpy(main_fn + 10, integer, integer_size); |
|
|
|
|
|
pContext->free(integer); |
|
|
|
|
|
main_fn[10 + integer_size] = 0; |
|
|
|
|
|
frame.executing.value = ink_add_indigenous(pContext, main_fn, executable_buffer, executable_buffer_top); |
|
|
|
|
|
if (frame.executing.value < 0) { |
|
|
|
|
|
pContext->panic = 1; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
frame.executing.type = INK_FUNCTION; |
|
|
|
|
|
frame.index = 0; |
|
|
|
|
|
err = ink_push_fn(pContext, frame); |
|
|
|
|
|
if (err < 0) { |
|
|
|
|
|
pContext->panic = 1; |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
pContext->routines[pContext->routine_current].panic = INK_ROUTINE_SUCCESS; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
pContext->routine_current = saved; |
|
|
pContext->routine_current = saved; |
|
|