This simple chunk of code is wreaking havoc when run if compiled with
Borland 4.52 or 5.0. Works fine in MSVC 4.0. It produces an invalid
mem read just after the throw long(1); line. Am I doing something wrong
or is it a borland bug?
Among other variations, if the break is placed outside the braces, the
problem goes away.
Thanks for any insight.
Jim Sermersheim
#include <stdio.h>
struct ABC
{
~ABC(){}
void Func1 (void)Quote:};
{
try
{
throw (int)2;
}
catch (int i)
{
switch (i)
{
case 2:
{
ABC abc;
break;
}
}
}
throw long(1);
void main (void)Quote:}
{
try
{
Func1();
}
catch (long exc)
{
printf("WooHoo!");
}
Quote:}
[ about comp.lang.c++.moderated. First time posters: do this! ]