[plt-scheme] scheme_signal_error

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Apr 17 11:33:46 EDT 2003

At Tue, 15 Apr 2003 17:59:12 +0200, Olivier ORABONA wrote:
> Scheme_Object* foo(void* p, int argc, Scheme_Object** argv) {
> 	Scheme_Object* tmp = argv[O];
> 	while(!SCHEME_NULLP(tmp)) {
> 		if(bar(SCHEME_CAR(tmp))==BAD_INPUT)
> 			scheme_signal_error("Bad Input");
> 		tmp=SCHEME_CDR(tmp);
> 	}
> 	return scheme_true;
> }

I'm stumped at the moment, so just to be sure on on track:

Are you certain that the crash occurs in scheme_signal_error() and not
with SCHEME_CAR() --- or, when you tried it, SCHEME_PAIRP()?

I ask because, if `tmp' is not a valid Scheme object, SCHEME_CAR() is
likely to crash by attempting to derefence the pointer. SCHEME_PAIRP()
will crash similarly. (SCHEME_NULLP() is diffrent; it merely compares
`tmp' to another pointer.)


Posted on the users mailing list.