Skip to content

Commit

Permalink
Print assertion failure to log and flush even if DEBUG is not defined
Browse files Browse the repository at this point in the history
TR_ASSERT_FATAL() could fail in any build, and in particular in builds
without DEBUG. Previously, if such a failure occurred with tracing
enabled, the process would crash without printing the failure to the
log, and more importantly, without flushing previously written trace
output, which was confusing and impeded debugging.
  • Loading branch information
jdmpapin committed Mar 1, 2024
1 parent a26218f commit da8387e
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions compiler/compile/OMRCompilation.cpp
Expand Up @@ -2483,17 +2483,14 @@ TR_Debug * OMR::Compilation::findOrCreateDebug()

void OMR::Compilation::diagnosticImpl(const char *s, ...)
{
#if defined(DEBUG)
va_list ap;
va_start(ap, s);
self()->diagnosticImplVA(s, ap);
va_end(ap);
#endif
}

void OMR::Compilation::diagnosticImplVA(const char *s, va_list ap)
{
#if defined(DEBUG)
if (self()->getOutFile() != NULL)
{
va_list copy;
Expand All @@ -2504,7 +2501,6 @@ void OMR::Compilation::diagnosticImplVA(const char *s, va_list ap)
trfflush(self()->getOutFile());
va_end(copy);
}
#endif
}


Expand Down

0 comments on commit da8387e

Please sign in to comment.