Skip to content

Instantly share code, notes, and snippets.

@koraa
Created November 9, 2015 10:23
Show Gist options
  • Save koraa/63fd688a118350e73f08 to your computer and use it in GitHub Desktop.
Save koraa/63fd688a118350e73f08 to your computer and use it in GitHub Desktop.
VS Min/Max crash
Stacktrace:
> inexor.exe!_VCrtDbgReportW(int nRptType, void * returnAddress, const wchar_t * szFile, int nLine, const wchar_t * szModule, const wchar_t * szFormat, char * arglist) Line 481 C++
inexor.exe!_CrtDbgReportW(int report_type, const wchar_t * file_name, int line_number, const wchar_t * module_name, const wchar_t * format, ...) Line 273 C++
[External Code]
inexor.exe!vec::min(const vec & o) Line 156 C++
inexor.exe!genclipplanes(const cube & c, const ivec & co, int size, clipplanes & p, bool collide) Line 1220 C++
inexor.exe!getclipplanes(const cube & c, const ivec & o, int size, bool collide, int offset) Line 22 C++
from _CrtDbgReportW on were somewhere inside error reporting code probably. however checking the values of the variables inside that code reveals an error inside algorithm:4178 which is:
definition where we get stuck inside std::min:
// TEMPLATE FUNCTION min
template<class _Ty> inline
_Post_equal_to_(_Right < _Left ? _Right : _Left)
_CONST_FUN const _Ty& (min)(const _Ty& _Left, const _Ty& _Right)
{ // return smaller of _Left and _Right
return (_DEBUG_LT(_Right, _Left) ? _Right : _Left); /// <- THIS IS the line which crashes
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment