instruction_list * call_list (instruction_list * ast) { instruction_list * list = NULL; for (instruction_list * current = ast; current != NULL; current = current->next) { instruction_type t = current->element->type; if (t == INSTR_CALL) { instruction_list * current_instr = instruction_list_alloc (); current_instr->element = current->element; current_instr->next = NULL; list = instruction_list_cat (list, current_instr); } else if (t == INSTR_FOR) { instruction_list * current_instr = call_list (current->element->content.loop.body); list = instruction_list_cat (list, current_instr); } else if (t == INSTR_IF || t == INSTR_IF_ELSE) { instruction_list * current_instr = call_list (current->element->content.branch.true_body); list = instruction_list_cat (list, current_instr); if (current->element->content.branch.has_else) { current_instr = call_list (current->element->content.branch.false_body); list = instruction_list_cat (list, current_instr); } } else if (t != INSTR_UNKNOWN) { instruction_list * current_instr = call_list (current->element->content.block); list = instruction_list_cat (list, current_instr); } } return list; }
void c_test (int max){ int i; for (f=1) } #line 23 "ko_6_1_0_perllint_01cc.c" #ifndef PERL_UNUSED_VAR # define PERL_UNUSED_VAR(var) if (0) var = var #endif #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params) /* prototype to pass -Wmissing-prototypes */ STATIC void S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params); STATIC void S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params) { const GV *const gv = CvGV(cv); PERL_ARGS_ASSERT_CROAK_XS_USAGE; if (gv) { const char *const gvname = GvNAME(gv); const HV *const stash = GvSTASH(gv); const char *const hvname = stash ? HvNAME(stash) : NULL; if (hvname) Perl_croak(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params); else Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params); } else { /* Pants. I don't think that it should be possible to get here. */ Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params); } } #undef PERL_ARGS_ASSERT_CROAK_XS_USAGE #ifdef PERL_IMPLICIT_CONTEXT #define croak_xs_usage(a,b) S_croak_xs_usage(aTHX_ a,b) #else #define croak_xs_usage S_croak_xs_usage #endif #endif /* NOTE: the prototype of newXSproto() is different in versions of perls, * so we define a portable version of newXSproto() */ #ifdef newXS_flags #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0) #else #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv) #endif /* !defined(newXS_flags) */ #line 75 "ko_6_1_0_perllint_01cc.c" XS(XS_main_c_test); /* prototype to pass -Wmissing-prototypes */ XS(XS_main_c_test) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) croak_xs_usage(cv, "max"); PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { int max = (int)SvIV(ST(0)); #line 22 "ko_6_1_0_perllint_01cc.xs" I32* temp; #line 93 "ko_6_1_0_perllint_01cc.c" #line 24 "ko_6_1_0_perllint_01cc.xs" temp = PL_markstack_ptr++; c_test(max); if (PL_markstack_ptr != temp) { /* truly void, because dXSARGS not invoked */ PL_markstack_ptr = temp; XSRETURN_EMPTY; /* return empty stack */ } /* must have used dXSARGS; list context implied */ return; /* assume stack size is correct */ #line 104 "ko_6_1_0_perllint_01cc.c" PUTBACK; return; } } #ifdef __cplusplus extern "C" #endif XS(boot_ko_6_1_0_perllint_01cc); /* prototype to pass -Wmissing-prototypes */ XS(boot_ko_6_1_0_perllint_01cc) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif #if (PERL_REVISION == 5 && PERL_VERSION < 9) char* file = __FILE__; #else const char* file = __FILE__; #endif PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(items); /* -W */ XS_VERSION_BOOTCHECK ; newXS("main::c_test", XS_main_c_test, file); #if (PERL_REVISION == 5 && PERL_VERSION >= 9) if (PL_unitcheckav) call_list(PL_scopestack_ix, PL_unitcheckav); #endif XSRETURN_YES; }