Here's another real world example, although it was in C:

char* ptr;
assert( ptr = malloc( memsize ); )

Of course, this worked when built in debug, but it took a while to
track down why it wasn't working in the release build (the assert()'s
were stripped out in the release builds, so ptr didn't allocate any
memory).  Unfortunately, the runtime failure happened in an entirely
different part of the code, since ptr wasn't initialized to null, so
this particular routine just merrily stomped on whatever memory address
happened to initialize in ptr.

-- Paul

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to