- Fix invalid polymer light array access originating from game's cleanup

callback 'G_Polymer_UnInit'.
- In astub.c, reset spritelightid to -1 when nulling the spritelightptr of
  a sprite  (no crashes observed, just precaution)
- In sdlayer.c, catch SIGILLs with our signal handler too, since illegal
  instructions are what the instrumented debug builds will execute when
  attempting to carry out an undefined (per C) operation.

git-svn-id: https://svn.eduke32.com/eduke32@2169 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-12-09 19:11:31 +00:00
parent 20d303ed15
commit 151287168c
3 changed files with 4 additions and 1 deletions

View file

@ -319,6 +319,7 @@ int32_t initsystem(void)
}
signal(SIGSEGV, sighandler);
signal(SIGILL, sighandler); /* clang -fcatch-undefined-behavior uses an ill. insn */
signal(SIGABRT, sighandler);
signal(SIGFPE, sighandler);

View file

@ -487,6 +487,7 @@ int32_t block_deletesprite = 0;
#ifdef POLYMER
static void A_DeletePolymerLight(int32_t s)
{
if (actor[s].lightId >= 0)
polymer_deletelight(actor[s].lightId);
actor[s].lightId = -1;
actor[s].lightptr = NULL;

View file

@ -315,6 +315,7 @@ static void DeletePolymerLights(void)
if (spritelightptr[i] != NULL)
{
polymer_deletelight(spritelightid[i]);
spritelightid[i] = -1;
spritelightptr[i] = NULL;
}
}