3) The embedding wrapper is responsible for setting and resetting the top of stack.
Proof-of-concept:
--- src/embed.c 2 May 2004 10:47:54 -0000 1.113
+++ src/embed.c 3 May 2004 19:08:23 -0000
@@ -666,6 +666,17 @@
void
Parrot_runcode(Interp *interpreter, int argc, char *argv[])
{
+ if(!interpreter->lo_var_ptr) {
+ int top;
+ if(Interp_flags_TEST(interpreter, PARROT_DEBUG_FLAG)) {
+ PIO_eprintf(interpreter,
+ "*** Parrot VM: Setting stack top. ***\n");
+ }
+ interpreter->lo_var_ptr=⊤
+ Parrot_runcode(interpreter, argc, argv);
+ interpreter->lo_var_ptr=NULL;
+ return;
+ }
/* Debugging mode nonsense. */
if (Interp_flags_TEST(interpreter, PARROT_DEBUG_FLAG)) {
if (Interp_flags_TEST(interpreter, PARROT_BOUNDS_FLAG)) {
--- src/interpreter.c 2 May 2004 10:47:54 -0000 1.306
+++ src/interpreter.c 3 May 2004 19:08:23 -0000
@@ -1726,6 +1726,7 @@
}
else {
SET_NULL(interpreter->parent_interpreter);
+ SET_NULL(interpreter->lo_var_ptr);
}
interpreter->resume_flag = RESUME_INITIAL;
-- Brent "Dax" Royal-Gordon <[EMAIL PROTECTED]> Perl and Parrot hacker
Oceania has always been at war with Eastasia.
