Skip to content

Commit

Permalink
borrow some code from the old PARROT_CALLIN_START macro set, and ensu…
Browse files Browse the repository at this point in the history
…re the stacktop pointer is set/reset
  • Loading branch information
Whiteknight committed Nov 10, 2010
1 parent 8499c81 commit d67e5d4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/embed/api.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#define EMBED_API_CALLIN(p, i) \ #define EMBED_API_CALLIN(p, i) \
jmp_buf _env; \ jmp_buf _env; \
Interp * (i) = PMC_IS_NULL(p) ? NULL : GET_RAW_INTERP(p); \ Interp * (i) = PMC_IS_NULL(p) ? NULL : GET_RAW_INTERP(p); \
void *_oldtop = (i)->lo_var_ptr; \
if (_oldtop) {} else (1)->lo_var_ptr = &oldtop \
if (!(i)) \ if (!(i)) \
return 0; \ return 0; \
if (setjmp(_env)) { \ if (setjmp(_env)) { \
Expand All @@ -15,6 +17,12 @@
{ {
#define EMBED_API_CALLOUT(p, i) \ #define EMBED_API_CALLOUT(p, i) \
} \ } \
do {\
if (!_oldtop) {\
PARROT_ASSERT((i)->lo_var_ptr == &oldtop);\
(i)->lo_var_ptr = NULL;\
}\
} while (0); \
return 1; \ return 1; \
} }


Expand Down

0 comments on commit d67e5d4

Please sign in to comment.