Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash test #3411

Merged
merged 2 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/clparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ bool ParseCommandLine(int argc, const char * const *argv)
case CLI_CRASH:
CauseCrash = true;
NetPlay.bComms = false;
SPinit(LEVEL_TYPE::CAMPAIGN);
sstrcpy(aLevelName, "CAM_3A");
SetGameMode(GS_NORMAL);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/display3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ void draw3DScene()
# pragma GCC diagnostic pop
#endif
}
exit(-1); // will never reach this, but just in case...
exit(-1); // should never reach this, but just in case...
}
//visualize radius if needed
if (bRangeDisplay)
Expand Down
10 changes: 9 additions & 1 deletion src/wzcrashhandlingproviders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,15 @@ bool crashHandlingProviderTestCrash()
RaiseException(0xE000DEAD, EXCEPTION_NONCONTINUABLE, 0, 0);
return false;
# else
// future todo: implement for other platforms
# if defined(WZ_CC_GNU) && !defined(WZ_CC_INTEL) && !defined(WZ_CC_CLANG) && (7 <= __GNUC__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
static void *invalid_mem = (void *)1;
memset((char *)invalid_mem, 1, 100);
# if defined(WZ_CC_GNU) && !defined(WZ_CC_INTEL) && !defined(WZ_CC_CLANG) && (7 <= __GNUC__)
# pragma GCC diagnostic pop
# endif
return false;
# endif
#else
Expand Down
Loading