This commit is contained in:
David CARLIER 2025-02-10 15:31:02 -01:00 committed by GitHub
commit 2ddc95e3a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View file

@ -540,6 +540,10 @@ void AssertFailed( const char *file, int line, const char *expression ) {
#ifdef _MSC_VER
__debugbreak();
_exit(1);
#elif defined(__clang__)
// More appropriate than __builtin_trap, indeed it does trigger SIGILL
// but SIGTRAP instead. only clang supports for now (so far).
__builtin_debugtrap();
#elif defined(__unix__)
// __builtin_trap() causes an illegal instruction which is kinda ugly.
// especially if you'd like to be able to continue after the assertion during debugging

View file

@ -1148,9 +1148,8 @@ idSlowChannel::Reset
===================
*/
void idSlowChannel::Reset() {
memset( this, 0, sizeof( *this ) );
this->chan = chan;
active = false;
chan = nullptr;
curPosition.Set( 0 );
newPosition.Set( 0 );
@ -1158,6 +1157,7 @@ void idSlowChannel::Reset() {
curSampleOffset = -10000;
newSampleOffset = -10000;
playbackState = 0;
triggerOffset = 0;
}