The R Project SVN R

Rev

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

Rev 70827 Rev 70845
Line 1253... Line 1253...
1253
    else {
1253
    else {
1254
	SEXP *cargscp = (SEXP *) R_alloc(nargs, sizeof(SEXP));
1254
	SEXP *cargscp = (SEXP *) R_alloc(nargs, sizeof(SEXP));
1255
	int i;
1255
	int i;
1256
	for(i = 0; i < nargs; i++)
1256
	for(i = 0; i < nargs; i++)
1257
	    cargscp[i] = PROTECT(duplicate(cargs[i]));
1257
	    cargscp[i] = PROTECT(duplicate(cargs[i]));
1258
	retval = R_doDotCall(ofun, nargs, cargs, call);
1258
	retval = PROTECT(R_doDotCall(ofun, nargs, cargs, call));
1259
	Rboolean constsOK = TRUE;
1259
	Rboolean constsOK = TRUE;
1260
	for(i = 0; constsOK && i < nargs; i++)
1260
	for(i = 0; constsOK && i < nargs; i++)
1261
            /* 7: not numerical comparison, not single NA, not attributes as
1261
	    /* 39: not numerical comparison, not single NA, not attributes as
1262
	       set, do ignore byte-code, do ignore environments of closures */
1262
               set, do ignore byte-code, do ignore environments of closures,
-
 
1263
               not ignore srcref
-
 
1264
 
-
 
1265
               srcref is not ignored because ignoring it is expensive
-
 
1266
               (it triggers duplication)
-
 
1267
	    */
1263
            if (!R_compute_identical(cargs[i], cargscp[i], 7)
1268
            if (!R_compute_identical(cargs[i], cargscp[i], 39)
1264
		    && !R_checkConstants(FALSE))
1269
		    && !R_checkConstants(FALSE))
1265
		constsOK = FALSE;
1270
		constsOK = FALSE;
1266
	if (!constsOK) {
1271
	if (!constsOK) {
1267
	    REprintf("ERROR: detected compiler constant(s) modification after"
1272
	    REprintf("ERROR: detected compiler constant(s) modification after"
1268
		" .Call invocation of function %s.\n", buf);
1273
		" .Call invocation of function %s.\n", buf);
1269
	    for(i = 0; i < nargs; i++)
1274
	    for(i = 0; i < nargs; i++)
1270
		if (!R_compute_identical(cargs[i], cargscp[i], 7))
1275
		if (!R_compute_identical(cargs[i], cargscp[i], 39))
1271
		    REprintf("NOTE: .Call function %s modified its argument"
1276
		    REprintf("NOTE: .Call function %s modified its argument"
1272
			" (number %d, type %s, length %d)\n",
1277
			" (number %d, type %s, length %d)\n",
1273
			buf,
1278
			buf,
1274
			i + 1,
1279
			i + 1,
1275
			CHAR(type2str(TYPEOF(cargscp[i]))),
1280
			CHAR(type2str(TYPEOF(cargscp[i]))),
1276
			length(cargscp[i])
1281
			length(cargscp[i])
1277
		    );
1282
		    );
1278
	    R_Suicide("compiler constants were modified (in .Call?)!\n");
1283
	    R_Suicide("compiler constants were modified (in .Call?)!\n");
1279
	}
1284
	}
1280
	UNPROTECT(nargs);
1285
	UNPROTECT(nargs + 1);
1281
    }
1286
    }
1282
    vmaxset(vmax);
1287
    vmaxset(vmax);
1283
    return retval;
1288
    return retval;
1284
}
1289
}
1285
 
1290