Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix build. all tests pass

git-svn-id: https://svn.parrot.org/parrot/branches/block_exit_handlers@45568 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit 757a4e8247e3aed23e59407700e2e67de4a4f07b 1 parent 332b937
whiteknight authored
View
9 include/parrot/context.h
@@ -150,6 +150,12 @@ PMC* Parrot_pcc_get_continuation_func(PARROT_INTERP, ARGIN(PMC *ctx))
PARROT_EXPORT
PARROT_CAN_RETURN_NULL
+PMC* Parrot_pcc_get_exit_handlers(PARROT_INTERP, ARGIN(PMC *ctx))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
PMC* Parrot_pcc_get_handlers_func(PARROT_INTERP, ARGIN(PMC *ctx))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -398,6 +404,9 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP,
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_pcc_get_exit_handlers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp) \
+ , PARROT_ASSERT_ARG(ctx))
#define ASSERT_ARGS_Parrot_pcc_get_handlers_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(ctx))
View
7 include/parrot/sub.h
@@ -249,6 +249,10 @@ PMC* Parrot_find_pad(PARROT_INTERP,
__attribute__nonnull__(2)
__attribute__nonnull__(3);
+void Parrot_sub_exe_exit_handlers(PARROT_INTERP, ARGIN(PMC *ctx))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
PARROT_CANNOT_RETURN_NULL
STRING * Parrot_Sub_get_filename_from_pc(PARROT_INTERP,
ARGIN_NULLOK(PMC *subpmc),
@@ -300,6 +304,9 @@ INTVAL Parrot_Sub_get_line_from_pc(PARROT_INTERP,
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(lex_name) \
, PARROT_ASSERT_ARG(ctx))
+#define ASSERT_ARGS_Parrot_sub_exe_exit_handlers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp) \
+ , PARROT_ASSERT_ARG(ctx))
#define ASSERT_ARGS_Parrot_Sub_get_filename_from_pc \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
View
4 src/call/context_accessors.c
@@ -761,10 +761,10 @@ Parrot_pcc_get_pmc_constant_func(PARROT_INTERP, ARGIN(PMC *ctx), INTVAL idx)
PARROT_EXPORT
PARROT_CAN_RETURN_NULL
PMC*
-Parrot_pcc_get_pmc_constant_func(PARROT_INTERP, ARGIN(PMC *ctx), INTVAL idx)
+Parrot_pcc_get_exit_handlers(PARROT_INTERP, ARGIN(PMC *ctx))
{
ASSERT_ARGS(Parrot_pcc_get_exit_handlers)
- Parrot_Context const * c = get_context_struct_fast(interp
+ Parrot_Context const * c = get_context_struct_fast(interp, ctx);
return c->exit_handler;
}
View
4 src/ops/core.ops
@@ -431,8 +431,8 @@ inline op returncc() :flow {
PMC * const curr_ctx = CURRENT_CONTEXT(interp);
PMC * const p = Parrot_pcc_get_continuation(interp, curr_ctx);
opcode_t * dest;
- Parrot_sub_exe_exit_handlers(INTERP, curr_ctx);
- opcode_t * const dest = VTABLE_invoke(interp, p, expr NEXT());
+ Parrot_sub_exe_exit_handlers(interp, curr_ctx);
+ dest = VTABLE_invoke(interp, p, expr NEXT());
goto ADDRESS(dest);
}
View
4 src/pmc/callcontext.pmc
@@ -448,7 +448,7 @@ pmclass CallContext provides array provides hash auto_attrs {
ATTR PMC *arg_flags; /* Integer array of argument flags */
ATTR PMC *return_flags; /* Integer array of return flags */
ATTR Hash *hash; /* Hash of named arguments */
- ATTR PMC * exit_handler; /* Handlers to execute on block exit */
+ ATTR PMC *exit_handler; /* Handlers to execute on block exit */
/*
@@ -1515,7 +1515,7 @@ sub, or for the point of the call a level deeper for the rest.
PMC * existing;
GET_ATTR_exit_handler(INTERP, SELF, existing);
if (PMC_IS_NULL(existing)) {
- SET_ATTR_exit_hander(INTERP, SELF, handler);
+ SET_ATTR_exit_handler(INTERP, SELF, handler);
RETURN();
}
else if (existing->vtable->base_type == enum_class_Sub) {
View
13 src/sub.c
@@ -591,26 +591,25 @@ Parrot_continuation_rewind_environment(PARROT_INTERP, ARGIN(PMC *pmc))
/*
-=item C<void Parrot_sub_exe_exit_handlers(PARROT_INTERP, ARGIN(PMC *ctx),
-ARGIN(PMC * handlers))>
+=item C<void Parrot_sub_exe_exit_handlers(PARROT_INTERP, PMC *ctx)>
=cut
*/
void
-Parrot_sub_exe_exit_handlers(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN(PMC * handlers))
+Parrot_sub_exe_exit_handlers(PARROT_INTERP, ARGIN(PMC *ctx))
{
ASSERT_ARGS(Parrot_sub_exe_exit_handlers)
- PMC * const exit_handler = Parrot_pcc_get_exit_handler(interp, ctx);
+ PMC * const exit_handler = Parrot_pcc_get_exit_handlers(interp, ctx);
if (PMC_IS_NULL(exit_handler))
return;
else {
- const INTVAL base_type = handlers->vtable->base_type;
+ const INTVAL base_type = exit_handler->vtable->base_type;
if (base_type == enum_class_Sub)
- Parrot_pcc_invoke_method_from_c_args(interp, ctx, handlers, "->");
+ Parrot_pcc_invoke_method_from_c_args(interp, ctx, exit_handler, "->");
else {
- PMC * const iter = VTABLE_get_iter(interp, handlers);
+ PMC * const iter = VTABLE_get_iter(interp, exit_handler);
while(VTABLE_get_bool(interp, iter)) {
PMC * const sub = VTABLE_shift_pmc(interp, iter);
Parrot_pcc_invoke_method_from_c_args(interp, ctx, sub, "->");
Please sign in to comment.
Something went wrong with that request. Please try again.