The R Project SVN R

Rev

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

Rev 78073 Rev 78125
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Copyright (C) 1995--2018  The R Core Team.
3
 *  Copyright (C) 1995--2020  The R Core Team.
4
 *
4
 *
5
 *  This program is free software; you can redistribute it and/or modify
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
6
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation; either version 2 of the License, or
7
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  (at your option) any later version.
8
 *  (at your option) any later version.
Line 1750... Line 1750...
1750
	SEXP entry = CAR(list);
1750
	SEXP entry = CAR(list);
1751
	R_HandlerStack = CDR(list);
1751
	R_HandlerStack = CDR(list);
1752
	Rstrncpy(buf, localbuf, BUFSIZE);
1752
	Rstrncpy(buf, localbuf, BUFSIZE);
1753
	/*	Rvsnprintf(buf, BUFSIZE - 1, format, ap);*/
1753
	/*	Rvsnprintf(buf, BUFSIZE - 1, format, ap);*/
1754
	if (IS_CALLING_ENTRY(entry)) {
1754
	if (IS_CALLING_ENTRY(entry)) {
1755
	    if (ENTRY_HANDLER(entry) == R_RestartToken)
1755
	    if (ENTRY_HANDLER(entry) == R_RestartToken) {
-
 
1756
		UNPROTECT(1); /* oldstack */
1756
		return; /* go to default error handling; do not reset stack */
1757
		return; /* go to default error handling; do not reset stack */
1757
	    else {
1758
	    } else {
1758
		/* if we are in the process of handling a C stack
1759
		/* if we are in the process of handling a C stack
1759
		   overflow, treat all calling handlers as failed */
1760
		   overflow, treat all calling handlers as failed */
1760
		if (R_OldCStackLimit)
1761
		if (R_OldCStackLimit)
1761
		    break;
1762
		    break;
1762
		SEXP hooksym, hcall, qcall, qfun;
1763
		SEXP hooksym, hcall, qcall, qfun;
Line 1765... Line 1766...
1765
		   overflow */
1766
		   overflow */
1766
		PROTECT(oldstack);
1767
		PROTECT(oldstack);
1767
		hooksym = install(".handleSimpleError");
1768
		hooksym = install(".handleSimpleError");
1768
		qfun = lang3(R_DoubleColonSymbol, R_BaseSymbol,
1769
		qfun = lang3(R_DoubleColonSymbol, R_BaseSymbol,
1769
		             R_QuoteSymbol);
1770
		             R_QuoteSymbol);
-
 
1771
		PROTECT(qfun);
1770
		PROTECT(qcall = LCONS(qfun,
1772
		PROTECT(qcall = LCONS(qfun,
1771
				      LCONS(call, R_NilValue)));
1773
				      LCONS(call, R_NilValue)));
1772
		PROTECT(hcall = LCONS(qcall, R_NilValue));
1774
		PROTECT(hcall = LCONS(qcall, R_NilValue));
1773
		hcall = LCONS(mkString(buf), hcall);
1775
		hcall = LCONS(mkString(buf), hcall);
1774
		hcall = LCONS(ENTRY_HANDLER(entry), hcall);
1776
		hcall = LCONS(ENTRY_HANDLER(entry), hcall);
Line 1889... Line 1891...
1889
 
1891
 
1890
    SEXP h = GetOption1(install("interrupt"));
1892
    SEXP h = GetOption1(install("interrupt"));
1891
    if (h != R_NilValue) {
1893
    if (h != R_NilValue) {
1892
	SEXP call = PROTECT(LCONS(h, R_NilValue));
1894
	SEXP call = PROTECT(LCONS(h, R_NilValue));
1893
	evalKeepVis(call, R_GlobalEnv);
1895
	evalKeepVis(call, R_GlobalEnv);
-
 
1896
	UNPROTECT(1);
1894
    }
1897
    }
1895
}
1898
}
1896
 
1899
 
1897
void attribute_hidden
1900
void attribute_hidden
1898
R_InsertRestartHandlers(RCNTXT *cptr, const char *cname)
1901
R_InsertRestartHandlers(RCNTXT *cptr, const char *cname)