The R Project SVN R

Rev

Rev 26646 | Rev 29340 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26646 Rev 27000
Line 617... Line 617...
617
	R_ClearerrConsole();
617
	R_ClearerrConsole();
618
	R_ParseError = 0;
618
	R_ParseError = 0;
619
    }
619
    }
620
 
620
 
621
    /* WARNING: If oldInError > 0 ABSOLUTELY NO ALLOCATION can be
621
    /* WARNING: If oldInError > 0 ABSOLUTELY NO ALLOCATION can be
622
       triggered after this point except whatever happens in
622
       triggered after this point except whatever happens in writing
623
       R_run_onexits.  The error could be an out of memory error and
623
       the traceback and R_run_onexits.  The error could be an out of
624
       any allocation could result in an infinite-loop condition. All
624
       memory error and any allocation could result in an
625
       you can do is reset things and exit.  */
625
       infinite-loop condition. All you can do is reset things and
-
 
626
       exit.  */
626
 
627
 
627
    /* jump to a browser/try if one is on the stack */
628
    /* jump to a browser/try if one is on the stack */
628
    if (! ignoreRestartContexts)
629
    if (! ignoreRestartContexts)
629
	try_jump_to_restart();
630
	try_jump_to_restart();
630
 
631
 
631
    /* at this point, i.e. if we have not exited in
632
    /* at this point, i.e. if we have not exited in
632
       try_jump_to_restart, we are heading for R_ToplevelContext */
633
       try_jump_to_restart, we are heading for R_ToplevelContext */
633
 
634
 
-
 
635
    /* only run traceback if we are not going to bail out of a
-
 
636
       non-interactive session */
-
 
637
    if (R_Interactive || haveHandler) {
-
 
638
	/* write traceback if requested, unless we're already doing it
-
 
639
	   or there is an inconsistenty between inError and oldInError
-
 
640
	   (which should not happen) */
-
 
641
	if (traceback && inError < 2 && inError == oldInError) {
-
 
642
	    inError = 2;
-
 
643
	    PROTECT(s = R_GetTraceback(0));
-
 
644
	    setVar(install(".Traceback"), s, R_GlobalEnv);
-
 
645
	    UNPROTECT(1);
-
 
646
	    inError = oldInError;
-
 
647
	}
-
 
648
    }
-
 
649
 
634
    /* Run onexit/cend code for all contexts down to but not including
650
    /* Run onexit/cend code for all contexts down to but not including
635
       the jump target.  This may cause recursive calls to
651
       the jump target.  This may cause recursive calls to
636
       jump_to_top_ex, but the possible number of such recursive
652
       jump_to_top_ex, but the possible number of such recursive
637
       calls is limited since each exit function is removed before it
653
       calls is limited since each exit function is removed before it
638
       is executed.  In addition, all but the first should have
654
       is executed.  In addition, all but the first should have
Line 647... Line 663...
647
    if ( !R_Interactive && !haveHandler ) {
663
    if ( !R_Interactive && !haveHandler ) {
648
	REprintf("Execution halted\n");
664
	REprintf("Execution halted\n");
649
	R_CleanUp(SA_NOSAVE, 1, 0); /* quit, no save, no .Last, status=1 */
665
	R_CleanUp(SA_NOSAVE, 1, 0); /* quit, no save, no .Last, status=1 */
650
    }
666
    }
651
 
667
 
652
    if (traceback && ! oldInError) {
-
 
653
	PROTECT(s = R_GetTraceback(0));
-
 
654
	setVar(install(".Traceback"), s, R_GlobalEnv);
-
 
655
	UNPROTECT(1);
-
 
656
    }
-
 
657
 
-
 
658
    R_GlobalContext = R_ToplevelContext;
668
    R_GlobalContext = R_ToplevelContext;
659
    R_restore_globals(R_GlobalContext);
669
    R_restore_globals(R_GlobalContext);
660
 
670
 
661
    LONGJMP(R_ToplevelContext->cjmpbuf, 0);
671
    LONGJMP(R_ToplevelContext->cjmpbuf, 0);
662
 
672