Remove optimization off of quest::ChooseRandom on msvc to solve a crash on x64 in release mode

This commit is contained in:
KimLS 2020-05-26 22:30:19 -07:00
parent 6a416a78a8
commit 8a0d4e37bd

View File

@ -1612,6 +1612,13 @@ XS(XS__respawn) {
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
//64 bit windows seems to optimize something poorly here causing access violations.
//If you don't do anything with index before passing it to perl it gets optimized out
//Disabling optimization right now for msvc on this function is the best solution.
#ifdef _MSC_VER
#pragma optimize( "", off )
#endif
XS(XS__ChooseRandom); XS(XS__ChooseRandom);
XS(XS__ChooseRandom) { XS(XS__ChooseRandom) {
dXSARGS; dXSARGS;
@ -1628,6 +1635,10 @@ XS(XS__ChooseRandom) {
XSRETURN(1); //return 1 element from the stack (ST(0)) XSRETURN(1); //return 1 element from the stack (ST(0))
} }
#ifdef _MSC_VER
#pragma optimize( "", on )
#endif
XS(XS__set_proximity); XS(XS__set_proximity);
XS(XS__set_proximity) { XS(XS__set_proximity) {
dXSARGS; dXSARGS;