mirror of
https://github.com/openRuyi-Project/gcc.git
synced 2026-06-22 03:15:59 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user