|
#ifndef __NUITKA_NO_ASSERT__ |
|
#ifndef __NUITKA_NO_ASSERT__ |
|
void checkModuleConstants___main__(void) { |
|
void checkModuleConstants___main__(void) { |
|
// The module may not have been used at all, then ignore this. |
|
// The module may not have been used at all, then ignore this. |
|
if (constants_created == false) return; |
|
if (constants_created == false) return; |
|
|
|
|
n |
checkConstantsBlob(&mod_consts[0], "__main__", 18); |
n |
checkConstantsBlob(&mod_consts[0], "__main__", 16); |
|
} |
|
} |
|
#endif |
|
#endif |
|
|
|
|
|
// The module code objects. |
|
// The module code objects. |
|
static PyCodeObject *codeobj_1b668ba03b46c40bbfd07633e286d2c2; |
|
static PyCodeObject *codeobj_1b668ba03b46c40bbfd07633e286d2c2; |
|
static PyCodeObject *codeobj_540f5583231358dedc042e899801d940; |
|
static PyCodeObject *codeobj_540f5583231358dedc042e899801d940; |
n |
static PyCodeObject *codeobj_81ef52d15720a47c85670c6504350aee; |
n |
|
|
/* For use in "MainProgram.c". */ |
|
/* For use in "MainProgram.c". */ |
|
PyCodeObject *codeobj_main = NULL; |
|
PyCodeObject *codeobj_main = NULL; |
|
|
|
|
|
static void createModuleCodeObjects(void) { |
|
static void createModuleCodeObjects(void) { |
n |
module_filename_obj = mod_consts[4]; CHECK_OBJECT(module_filename_obj); |
n |
module_filename_obj = mod_consts[1]; CHECK_OBJECT(module_filename_obj); |
|
codeobj_1b668ba03b46c40bbfd07633e286d2c2 = MAKE_CODEOBJECT(module_filename_obj, 1, CO_NOFREE, mod_consts[16], NULL, NULL, 0, 0, 0); |
|
codeobj_1b668ba03b46c40bbfd07633e286d2c2 = MAKE_CODEOBJECT(module_filename_obj, 1, CO_NOFREE, mod_consts[14], NULL, NULL, 0, 0, 0); |
|
codeobj_540f5583231358dedc042e899801d940 = MAKE_CODEOBJECT(module_filename_obj, 23, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE, mod_consts[8], mod_consts[17], NULL, 0, 0, 0); |
|
codeobj_540f5583231358dedc042e899801d940 = MAKE_CODEOBJECT(module_filename_obj, 23, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE, mod_consts[6], mod_consts[15], NULL, 0, 0, 0); |
|
codeobj_81ef52d15720a47c85670c6504350aee = MAKE_CODEOBJECT(module_filename_obj, 26, CO_GENERATOR | CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE, mod_consts[0], NULL, NULL, 0, 0, 0); |
|
|
|
} |
|
} |
|
|
|
|
|
// The module function declarations. |
|
// The module function declarations. |
n |
static PyObject *MAKE_GENERATOR___main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty(); |
n |
|
|
|
|
|
|
|
|
|
|
static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly(); |
|
static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly(); |
|
|
|
|
|
|
|
|
n |
static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly$$$function__1_empty(); |
n |
|
|
|
|
|
|
|
|
|
|
// The module function definitions. |
|
// The module function definitions. |
n |
static PyObject *impl___main__$$$function__1_calledRepeatedly(struct Nuitka_FunctionObject const *self, PyObject **python_pars) { |
n |
|
|
// Preserve error status for checks |
|
|
|
#ifndef __NUITKA_NO_ASSERT__ |
|
|
|
NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); |
|
|
|
#endif |
|
|
|
|
|
|
|
// Local variable declarations. |
|
|
|
PyObject *var_empty = NULL; |
|
|
|
PyObject *tmp_return_value = NULL; |
|
|
|
|
|
|
|
// Actual function body. |
|
|
|
{ |
|
|
|
PyObject *tmp_assign_source_1; |
|
|
|
|
|
|
|
|
|
|
|
tmp_assign_source_1 = MAKE_FUNCTION___main__$$$function__1_calledRepeatedly$$$function__1_empty(); |
|
|
|
|
|
|
|
assert(var_empty == NULL); |
|
|
|
var_empty = tmp_assign_source_1; |
|
|
|
} |
|
|
|
// Tried code: |
|
|
|
CHECK_OBJECT(var_empty); |
|
|
|
tmp_return_value = var_empty; |
|
|
|
Py_INCREF(tmp_return_value); |
|
|
|
goto try_return_handler_1; |
|
|
|
NUITKA_CANNOT_GET_HERE("tried codes exits in all cases"); |
|
|
|
return NULL; |
|
|
|
// Return handler code: |
|
|
|
try_return_handler_1:; |
|
|
|
CHECK_OBJECT(var_empty); |
|
|
|
Py_DECREF(var_empty); |
|
|
|
var_empty = NULL; |
|
|
|
goto function_return_exit; |
|
|
|
// End of try: |
|
|
|
|
|
|
|
NUITKA_CANNOT_GET_HERE("Return statement must have exited already."); |
|
|
|
return NULL; |
|
|
|
|
|
|
|
|
|
|
|
function_return_exit: |
|
|
|
// Function cleanup code if any. |
|
|
|
|
|
|
|
|
|
|
|
// Actual function exit with return value, making sure we did not make |
|
|
|
// the error status worse despite non-NULL return. |
|
|
|
CHECK_OBJECT(tmp_return_value); |
|
|
|
assert(had_error || !ERROR_OCCURRED()); |
|
|
|
return tmp_return_value; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static PyObject *impl___main__$$$function__1_calledRepeatedly$$$function__1_empty(struct Nuitka_FunctionObject const *self, PyObject **python_pars) { |
|
|
|
// Preserve error status for checks |
|
|
|
#ifndef __NUITKA_NO_ASSERT__ |
|
|
|
NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); |
|
|
|
#endif |
|
|
|
|
|
|
|
// Local variable declarations. |
|
|
|
PyObject *tmp_return_value = NULL; |
|
|
|
|
|
|
|
// Actual function body. |
|
|
|
|
|
|
|
|
|
|
|
tmp_return_value = MAKE_GENERATOR___main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty(); |
|
|
|
|
|
|
|
goto function_return_exit; |
|
|
|
|
|
|
|
NUITKA_CANNOT_GET_HERE("Return statement must have exited already."); |
|
|
|
return NULL; |
|
|
|
|
|
|
|
|
|
|
|
function_return_exit: |
|
|
|
// Function cleanup code if any. |
|
|
|
|
|
|
|
|
|
|
|
// Actual function exit with return value, making sure we did not make |
|
|
|
// the error status worse despite non-NULL return. |
|
|
|
CHECK_OBJECT(tmp_return_value); |
|
|
|
assert(had_error || !ERROR_OCCURRED()); |
|
|
|
return tmp_return_value; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct __main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty_locals { |
|
|
|
char const *type_description_1; |
|
|
|
PyObject *exception_type; |
|
|
|
PyObject *exception_value; |
|
|
|
PyTracebackObject *exception_tb; |
|
|
|
int exception_lineno; |
|
|
|
}; |
|
|
|
|
|
|
|
static PyObject *__main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty_context(struct Nuitka_GeneratorObject *generator, PyObject *yield_return_value) { |
|
|
|
CHECK_OBJECT(generator); |
|
|
|
assert(Nuitka_Generator_Check((PyObject *)generator)); |
|
|
|
CHECK_OBJECT_X(yield_return_value); |
|
|
|
|
|
|
|
// Heap access if used. |
|
|
|
struct __main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty_locals *generator_heap = (struct __main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty_locals *)generator->m_heap_storage; |
|
|
|
|
|
|
|
// Dispatch to yield based on return label index: |
|
|
|
switch(generator->m_yield_return_index) { |
|
|
|
case 1: goto yield_return_1; |
|
|
|
} |
|
|
|
|
|
|
|
// Local variable initialization |
|
|
|
NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused; |
|
|
|
static struct Nuitka_FrameObject *cache_m_frame = NULL; |
|
|
|
generator_heap->type_description_1 = NULL; |
|
|
|
generator_heap->exception_type = NULL; |
|
|
|
generator_heap->exception_value = NULL; |
|
|
|
generator_heap->exception_tb = NULL; |
|
|
|
generator_heap->exception_lineno = 0; |
|
|
|
|
|
|
|
// Actual generator function body. |
|
|
|
if (isFrameUnusable(cache_m_frame)) { |
|
|
|
Py_XDECREF(cache_m_frame); |
|
|
|
|
|
|
|
#if _DEBUG_REFCOUNTS |
|
|
|
if (cache_m_frame == NULL) { |
|
|
|
count_active_frame_cache_instances += 1; |
|
|
|
} else { |
|
|
|
count_released_frame_cache_instances += 1; |
|
|
|
} |
|
|
|
count_allocated_frame_cache_instances += 1; |
|
|
|
#endif |
|
|
|
cache_m_frame = MAKE_FUNCTION_FRAME(codeobj_81ef52d15720a47c85670c6504350aee, module___main__, 0); |
|
|
|
#if _DEBUG_REFCOUNTS |
|
|
|
} else { |
|
|
|
count_hit_frame_cache_instances += 1; |
|
|
|
#endif |
|
|
|
} |
|
|
|
generator->m_frame = cache_m_frame; |
|
|
|
|
|
|
|
// Mark the frame object as in use, ref count 1 will be up for reuse. |
|
|
|
Py_INCREF(generator->m_frame); |
|
|
|
assert(Py_REFCNT(generator->m_frame) == 2); // Frame stack |
|
|
|
|
|
|
|
#if PYTHON_VERSION >= 0x340 |
|
|
|
generator->m_frame->m_frame.f_gen = (PyObject *)generator; |
|
|
|
#endif |
|
|
|
|
|
|
|
assert(generator->m_frame->m_frame.f_back == NULL); |
|
|
|
Py_CLEAR(generator->m_frame->m_frame.f_back); |
|
|
|
|
|
|
|
generator->m_frame->m_frame.f_back = PyThreadState_GET()->frame; |
|
|
|
Py_INCREF(generator->m_frame->m_frame.f_back); |
|
|
|
|
|
|
|
PyThreadState_GET()->frame = &generator->m_frame->m_frame; |
|
|
|
Py_INCREF(generator->m_frame); |
|
|
|
|
|
|
|
Nuitka_Frame_MarkAsExecuting(generator->m_frame); |
|
|
|
|
|
|
|
#if PYTHON_VERSION >= 0x300 |
|
|
|
// Accept currently existing exception as the one to publish again when we |
|
|
|
// yield or yield from. |
|
|
|
{ |
|
|
|
PyThreadState *thread_state = PyThreadState_GET(); |
|
|
|
|
|
|
|
EXC_TYPE_F(generator) = EXC_TYPE(thread_state); |
|
|
|
if (EXC_TYPE_F(generator) == Py_None) EXC_TYPE_F(generator) = NULL; |
|
|
|
Py_XINCREF(EXC_TYPE_F(generator)); |
|
|
|
EXC_VALUE_F(generator) = EXC_VALUE(thread_state); |
|
|
|
Py_XINCREF(EXC_VALUE_F(generator)); |
|
|
|
EXC_TRACEBACK_F(generator) = EXC_TRACEBACK(thread_state); |
|
|
|
Py_XINCREF(EXC_TRACEBACK_F(generator)); |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
// Framed code: |
|
|
|
{ |
|
|
|
PyObject *tmp_expression_name_1; |
|
|
|
NUITKA_MAY_BE_UNUSED PyObject *tmp_yield_result_1; |
|
|
|
tmp_expression_name_1 = mod_consts[2]; |
|
|
|
Py_INCREF(tmp_expression_name_1); |
|
|
|
generator->m_yield_return_index = 1; |
|
|
|
return tmp_expression_name_1; |
|
|
|
yield_return_1: |
|
|
|
if (yield_return_value == NULL) { |
|
|
|
assert(ERROR_OCCURRED()); |
|
|
|
|
|
|
|
FETCH_ERROR_OCCURRED(&generator_heap->exception_type, &generator_heap->exception_value, &generator_heap->exception_tb); |
|
|
|
|
|
|
|
|
|
|
|
generator_heap->exception_lineno = 27; |
|
|
|
|
|
|
|
goto frame_exception_exit_1; |
|
|
|
} |
|
|
|
tmp_yield_result_1 = yield_return_value; |
|
|
|
} |
|
|
|
|
|
|
|
Nuitka_Frame_MarkAsNotExecuting(generator->m_frame); |
|
|
|
|
|
|
|
#if PYTHON_VERSION >= 0x300 |
|
|
|
Py_CLEAR(EXC_TYPE_F(generator)); |
|
|
|
Py_CLEAR(EXC_VALUE_F(generator)); |
|
|
|
Py_CLEAR(EXC_TRACEBACK_F(generator)); |
|
|
|
#endif |
|
|
|
|
|
|
|
// Allow re-use of the frame again. |
|
|
|
Py_DECREF(generator->m_frame); |
|
|
|
goto frame_no_exception_1; |
|
|
|
|
|
|
|
frame_exception_exit_1:; |
|
|
|
|
|
|
|
// If it's not an exit exception, consider and create a traceback for it. |
|
|
|
if (!EXCEPTION_MATCH_GENERATOR(generator_heap->exception_type)) { |
|
|
|
if (generator_heap->exception_tb == NULL) { |
|
|
|
generator_heap->exception_tb = MAKE_TRACEBACK(generator->m_frame, generator_heap->exception_lineno); |
|
|
|
} else if (generator_heap->exception_tb->tb_frame != &generator->m_frame->m_frame) { |
|
|
|
generator_heap->exception_tb = ADD_TRACEBACK(generator_heap->exception_tb, generator->m_frame, generator_heap->exception_lineno); |
|
|
|
} |
|
|
|
|
|
|
|
Nuitka_Frame_AttachLocals( |
|
|
|
generator->m_frame, |
|
|
|
generator_heap->type_description_1 |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Release cached frame if used for exception. |
|
|
|
if (generator->m_frame == cache_m_frame) { |
|
|
|
#if _DEBUG_REFCOUNTS |
|
|
|
count_active_frame_cache_instances -= 1; |
|
|
|
count_released_frame_cache_instances += 1; |
|
|
|
#endif |
|
|
|
|
|
|
|
Py_DECREF(cache_m_frame); |
|
|
|
cache_m_frame = NULL; |
|
|
|
} |
|
|
|
|
|
|
|
assertFrameObject(generator->m_frame); |
|
|
|
} |
|
|
|
|
|
|
|
#if PYTHON_VERSION >= 0x300 |
|
|
|
Py_CLEAR(EXC_TYPE_F(generator)); |
|
|
|
Py_CLEAR(EXC_VALUE_F(generator)); |
|
|
|
Py_CLEAR(EXC_TRACEBACK_F(generator)); |
|
|
|
#endif |
|
|
|
|
|
|
|
Py_DECREF(generator->m_frame); |
|
|
|
|
|
|
|
// Return the error. |
|
|
|
goto function_exception_exit; |
|
|
|
|
|
|
|
frame_no_exception_1:; |
|
|
|
|
|
|
|
|
|
|
|
return NULL; |
|
|
|
|
|
|
|
function_exception_exit: |
|
|
|
assert(generator_heap->exception_type); |
|
|
|
RESTORE_ERROR_OCCURRED(generator_heap->exception_type, generator_heap->exception_value, generator_heap->exception_tb); |
|
|
|
|
|
|
|
return NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
static PyObject *MAKE_GENERATOR___main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty() { |
|
|
|
return Nuitka_Generator_New( |
|
|
|
__main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty_context, |
|
|
|
module___main__, |
|
|
|
mod_consts[0], |
|
|
|
#if PYTHON_VERSION >= 0x350 |
|
|
|
mod_consts[1], |
|
|
|
#endif |
|
|
|
codeobj_81ef52d15720a47c85670c6504350aee, |
|
|
|
NULL, |
|
|
|
0, |
|
|
|
sizeof(struct __main__$$$function__1_calledRepeatedly$$$function__1_empty$$$genobj__1_empty_locals) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly() { |
|
static PyObject *MAKE_FUNCTION___main__$$$function__1_calledRepeatedly() { |
|
struct Nuitka_FunctionObject *result = Nuitka_Function_New( |
|
struct Nuitka_FunctionObject *result = Nuitka_Function_New( |
n |
impl___main__$$$function__1_calledRepeatedly, |
n |
NULL, |
|
mod_consts[8], |
|
mod_consts[6], |
|
#if PYTHON_VERSION >= 0x300 |
|
#if PYTHON_VERSION >= 0x300 |
|
NULL, |
|
NULL, |
|
#endif |
|
#endif |
|
codeobj_540f5583231358dedc042e899801d940, |
|
codeobj_540f5583231358dedc042e899801d940, |
|
NULL, |
|
NULL, |
|
|
|
|
|
// Module code. |
|
// Module code. |
|
{ |
|
{ |
|
PyObject *tmp_assign_source_1; |
|
PyObject *tmp_assign_source_1; |
|
tmp_assign_source_1 = Py_None; |
|
tmp_assign_source_1 = Py_None; |
n |
UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[3], tmp_assign_source_1); |
n |
UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[0], tmp_assign_source_1); |
|
} |
|
} |
|
{ |
|
{ |
|
PyObject *tmp_assign_source_2; |
|
PyObject *tmp_assign_source_2; |
n |
tmp_assign_source_2 = mod_consts[4]; |
n |
tmp_assign_source_2 = mod_consts[1]; |
|
UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[5], tmp_assign_source_2); |
|
UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[2], tmp_assign_source_2); |
|
} |
|
} |
|
{ |
|
{ |
|
PyObject *tmp_assign_source_3; |
|
PyObject *tmp_assign_source_3; |
|
tmp_assign_source_3 = Py_None; |
|
tmp_assign_source_3 = Py_None; |
n |
UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[6], tmp_assign_source_3); |
n |
UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[3], tmp_assign_source_3); |
|
} |
|
} |
|
{ |
|
{ |
|
PyObject *tmp_assign_source_4; |
|
PyObject *tmp_assign_source_4; |
|
tmp_assign_source_4 = Py_None; |
|
tmp_assign_source_4 = Py_None; |
n |
UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[7], tmp_assign_source_4); |
n |
UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)mod_consts[4], tmp_assign_source_4); |
|
} |
|
} |
|
{ |
|
{ |
|
PyObject *tmp_assign_source_5; |
|
PyObject *tmp_assign_source_5; |
|
|
|
|
|
|
|
|
|
tmp_assign_source_5 = MAKE_FUNCTION___main__$$$function__1_calledRepeatedly(); |
|
tmp_assign_source_5 = MAKE_FUNCTION___main__$$$function__1_calledRepeatedly(); |
|
|
|
|
n |
UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[8], tmp_assign_source_5); |
n |
UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[6], tmp_assign_source_5); |
|
} |
|
} |
|
{ |
|
{ |
|
PyObject *tmp_assign_source_6; |
|
PyObject *tmp_assign_source_6; |
|
PyObject *tmp_name_name_1; |
|
PyObject *tmp_name_name_1; |
|
PyObject *tmp_globals_arg_name_1; |
|
PyObject *tmp_globals_arg_name_1; |
|
PyObject *tmp_locals_arg_name_1; |
|
PyObject *tmp_locals_arg_name_1; |
|
PyObject *tmp_fromlist_name_1; |
|
PyObject *tmp_fromlist_name_1; |
|
PyObject *tmp_level_name_1; |
|
PyObject *tmp_level_name_1; |
n |
tmp_name_name_1 = mod_consts[9]; |
n |
tmp_name_name_1 = mod_consts[7]; |
|
tmp_globals_arg_name_1 = (PyObject *)moduledict___main__; |
|
tmp_globals_arg_name_1 = (PyObject *)moduledict___main__; |
|
tmp_locals_arg_name_1 = Py_None; |
|
tmp_locals_arg_name_1 = Py_None; |
|
tmp_fromlist_name_1 = Py_None; |
|
tmp_fromlist_name_1 = Py_None; |
n |
tmp_level_name_1 = mod_consts[10]; |
n |
tmp_level_name_1 = mod_consts[8]; |
|
tmp_assign_source_6 = IMPORT_MODULE5(tmp_name_name_1, tmp_globals_arg_name_1, tmp_locals_arg_name_1, tmp_fromlist_name_1, tmp_level_name_1); |
|
tmp_assign_source_6 = IMPORT_MODULE5(tmp_name_name_1, tmp_globals_arg_name_1, tmp_locals_arg_name_1, tmp_fromlist_name_1, tmp_level_name_1); |
|
assert(!(tmp_assign_source_6 == NULL)); |
|
assert(!(tmp_assign_source_6 == NULL)); |
n |
UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[9], tmp_assign_source_6); |
n |
UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[7], tmp_assign_source_6); |
|
} |
|
} |
|
// Frame without reuse. |
|
// Frame without reuse. |
|
frame_1b668ba03b46c40bbfd07633e286d2c2 = MAKE_MODULE_FRAME(codeobj_1b668ba03b46c40bbfd07633e286d2c2, module___main__); |
|
frame_1b668ba03b46c40bbfd07633e286d2c2 = MAKE_MODULE_FRAME(codeobj_1b668ba03b46c40bbfd07633e286d2c2, module___main__); |
|
|
|
|
|
// Push the new frame as the currently active one, and we should be exclusively |
|
// Push the new frame as the currently active one, and we should be exclusively |