natThrowable.cc (fillInStackTrace): Check for zero return from backtrace().

2000-07-19  Jeff Sturm  <jeff.sturm@appnet.com>

	* java/lang/natThrowable.cc (fillInStackTrace): Check for
	zero return from backtrace().

From-SVN: r35135
This commit is contained in:
Jeff Sturm 2000-07-19 14:37:56 +00:00 committed by Tom Tromey
parent 4e62ab0ba3
commit 5cc80caa27
2 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2000-07-19 Jeff Sturm <jeff.sturm@appnet.com>
* java/lang/natThrowable.cc (fillInStackTrace): Check for
zero return from backtrace().
2000-07-15 Bryce McKinlay <bryce@albatross.co.nz>
* java/awt/EventQueue.java (invokeAndWait): Call postEvent() within

View File

@ -61,9 +61,12 @@ java::lang::Throwable::fillInStackTrace (void)
int n = backtrace (p, 128) - 1;
#endif
// ??? Might this cause a problem if the byte array isn't aligned?
stackTrace = JvNewByteArray (n * sizeof p[0]);
memcpy (elements (stackTrace), p+1, (n * sizeof p[0]));
if (n > 0)
{
// ??? Might this cause a problem if the byte array isn't aligned?
stackTrace = JvNewByteArray (n * sizeof p[0]);
memcpy (elements (stackTrace), p+1, (n * sizeof p[0]));
}
#endif