Author: leo
Date: Fri Apr 29 00:31:39 2005
New Revision: 7943

Modified:
   trunk/build_tools/ops2c.pl
   trunk/lib/Parrot/OpTrans/CGoto.pm
   trunk/src/interpreter.c
   trunk/src/sub.c
Log:
fix #35144 - GC bug in CGoto runcores

Modified: trunk/build_tools/ops2c.pl
==============================================================================
--- trunk/build_tools/ops2c.pl  (original)
+++ trunk/build_tools/ops2c.pl  Fri Apr 29 00:31:39 2005
@@ -365,8 +365,6 @@
     else if (cur_opcode == (opcode_t *) 1)
        asm ("jmp *4(%ebp)");   /* jump to ret addr, used by JIT */
 # endif
-    else
-      _check();
 #endif
     _reg_base = (char*)interpreter->ctx.bp;
     goto *((void *)*cur_opcode);
@@ -374,9 +372,6 @@
 END_C
 } elsif ($suffix =~ /cg/) {
     print SOURCE <<END_C;
-#ifdef __GNUC__
-    _check();
-#endif
 goto *${bs}ops_addr[*cur_opcode];
 
 END_C

Modified: trunk/lib/Parrot/OpTrans/CGoto.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/CGoto.pm   (original)
+++ trunk/lib/Parrot/OpTrans/CGoto.pm   Fri Apr 29 00:31:39 2005
@@ -325,17 +325,6 @@
 
     return <<END_C;
 
-/* #ifdef HAVE_NESTED_FUNC */
-#ifdef __GNUC__
-    static void _check(void);
-    static void _check(void) {
-       int lo_var_ptr;
-       if (!interpreter->lo_var_ptr)
-           interpreter->lo_var_ptr = (void*)&lo_var_ptr;
-    }
-#endif
-/* #endif */
-
     if (!${bs}ops_addr)
        ${bs}ops_addr = l_ops_addr;
     if (cur_opcode == 0) {

Modified: trunk/src/interpreter.c
==============================================================================
--- trunk/src/interpreter.c     (original)
+++ trunk/src/interpreter.c     Fri Apr 29 00:31:39 2005
@@ -656,7 +656,6 @@
 runops_int(Interp *interpreter, size_t offset)
 {
     int lo_var_ptr;
-    void *old_lo_var_ptr;
     opcode_t *(*core) (Interp *, opcode_t *) =
         (opcode_t *(*) (Interp *, opcode_t *)) 0;
 
@@ -681,7 +680,6 @@
         opcode_t *pc = (opcode_t *)
             interpreter->code->base.data + interpreter->resume_offset;
 
-        old_lo_var_ptr = interpreter->lo_var_ptr;
         interpreter->resume_offset = 0;
         interpreter->resume_flag &= ~(RESUME_RESTART | RESUME_INITIAL);
         switch (interpreter->run_core) {
@@ -705,15 +703,6 @@
                 break;
             case PARROT_CGOTO_CORE:
 #ifdef HAVE_COMPUTED_GOTO
-                /* clear stacktop, it gets set in runops_cgoto_core beyond the
-                 * opfunc table again, if the compiler supports nested funcs
-                 * - but only, if we are the top running loop
-                 */
-                /* #ifdef HAVE_NESTED_FUNC */
-#  ifdef __GNUC__
-                if (old_lo_var_ptr == interpreter->lo_var_ptr)
-                    interpreter->lo_var_ptr = 0;
-#  endif
                 core = runops_cgoto_core;
 #else
                 internal_exception(1, "Error: PARROT_CGOTO_CORE not 
available");
@@ -754,7 +743,6 @@
          * the stacktop again to a sane value, so that restarting the runloop
          * is ok.
          */
-        interpreter->lo_var_ptr = old_lo_var_ptr;
         if (interpreter->resume_flag & RESUME_RESTART) {
             if ((int)interpreter->resume_offset < 0)
                 internal_exception(1, "branch_cs: illegal resume offset");

Modified: trunk/src/sub.c
==============================================================================
--- trunk/src/sub.c     (original)
+++ trunk/src/sub.c     Fri Apr 29 00:31:39 2005
@@ -563,6 +563,9 @@
     info->file = "(unknown file)";
     info->line = -1;
     info->pc = -1;
+    info->nsname = NULL;
+    info->subname = NULL;
+    info->fullname = NULL;
 
     /* is the current sub of the specified context valid? */
     if (PMC_IS_NULL(ctx->current_sub)) {
@@ -576,9 +579,6 @@
     /* make sure there is a sub (not always the case, e.g in pasm code) */
     if (ctx->current_sub->vtable->base_type == enum_class_Undef ||
            PMC_sub(ctx->current_sub)->address == 0) {
-       info->nsname = NULL;
-       info->subname = NULL;
-       info->fullname = NULL;
        /* XXX: is this correct? (try with load_bytecode) */
        /* use the current interpreter's bytecode as start address */
        if (ctx->current_pc != NULL)

Reply via email to