[rkward-cvs] rkward/rkward/rbackend rembedinternal.cpp,1.39,1.40

Thomas Friedrichsmeier tfry at users.sourceforge.net
Thu Apr 20 16:22:43 UTC 2006


Update of /cvsroot/rkward/rkward/rkward/rbackend
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20099/rkward/rbackend

Modified Files:
	rembedinternal.cpp 
Log Message:
Handle "weird" parse errors (result of parse is a NULL expression, but R_ParseVector says PARSE_OK)

Index: rembedinternal.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rbackend/rembedinternal.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** rembedinternal.cpp	18 Apr 2006 01:14:40 -0000	1.39
--- rembedinternal.cpp	20 Apr 2006 16:22:41 -0000	1.40
***************
*** 403,406 ****
--- 403,414 ----
  	UNPROTECT(1);
  
+ 	if ((!pr) || (TYPEOF (pr) == NILSXP)) {
+ 		// got a null SEXP. This means parse was *not* ok, even if R_ParseVector told us otherwise
+ 		if (status == PARSE_OK) {
+ 			status = PARSE_ERROR;
+ 		    printf ("weird parse error\n");
+ 		}
+ 	}
+ 
  	if (status != PARSE_OK) {
  		if ((status == PARSE_INCOMPLETE) || (status == PARSE_EOF)) {
***************
*** 437,440 ****
--- 445,450 ----
  			*error = REmbedInternal::NoError;
  		}
+ 
+ 		UNPROTECT(1); /* pr */
  	}
  
***************
*** 446,450 ****
  
  //	SET_SYMVALUE(R_LastvalueSymbol, exp);
- 	UNPROTECT(1); /* pr */
  
  	return exp;
--- 456,459 ----





More information about the rkward-tracker mailing list