[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

Re: easy to miss bug (even in structured debug)



How would the code-checker handle this?

	T * p;

	p = someT1P;
	...
	if (VERY screwy expression that happens always to be true) {
		p = someT2P;
	}
	...
	subTakingOnlyT2(p);

Remember, this is a major oversimplification of what it would see.

The point I'm trying to make is that, in the general case, determining
what a pointer may contain by reading the code is NOT simple.  You must
instead restrict the input code so the test can be made.

Would the point have been made more clearly if the last statement had been:

	if (IS_KIND_OF(T1,p)) { halt(); }

?

	michael