aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2025-03-17 17:40:26 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2025-03-17 17:40:26 +0100
commit025b20005f8988b28fa3bd429adca6fe279edcbc (patch)
tree997420d3ac9eaa5ecf15980bad9cff3647605534
parent7acc7867a8ebee0a3467a382b6998cb4e95580ed (diff)
downloadlanes-025b20005f8988b28fa3bd429adca6fe279edcbc.tar.gz
lanes-025b20005f8988b28fa3bd429adca6fe279edcbc.tar.bz2
lanes-025b20005f8988b28fa3bd429adca6fe279edcbc.zip
Circumvent MSVC possible bug causing a crash in optimized builds
Diffstat (limited to '')
-rw-r--r--Lanes.vcxproj3
-rw-r--r--src/universe.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/Lanes.vcxproj b/Lanes.vcxproj
index 1575789..b709f92 100644
--- a/Lanes.vcxproj
+++ b/Lanes.vcxproj
@@ -745,7 +745,6 @@ xcopy /F /I /R /Y "$(OutputPath)$(TargetName).pdb" $(SolutionDir)..\..\..\Lua54\
745 </Command> 745 </Command>
746 </PreBuildEvent> 746 </PreBuildEvent>
747 <ClCompile> 747 <ClCompile>
748 <Optimization>Disabled</Optimization>
749 <AdditionalIncludeDirectories>$(SolutionDir)..\..\..\Lua53\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 748 <AdditionalIncludeDirectories>$(SolutionDir)..\..\..\Lua53\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
750 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> 749 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
751 <MinimalRebuild>false</MinimalRebuild> 750 <MinimalRebuild>false</MinimalRebuild>
@@ -785,7 +784,6 @@ xcopy /F /I /R /Y "$(OutputPath)$(TargetName).pdb" $(SolutionDir)..\..\..\Lua513
785 </Command> 784 </Command>
786 </PreBuildEvent> 785 </PreBuildEvent>
787 <ClCompile> 786 <ClCompile>
788 <Optimization>Disabled</Optimization>
789 <AdditionalIncludeDirectories>$(SolutionDir)..\..\..\Lua54\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 787 <AdditionalIncludeDirectories>$(SolutionDir)..\..\..\Lua54\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
790 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> 788 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
791 <PrecompiledHeader>Use</PrecompiledHeader> 789 <PrecompiledHeader>Use</PrecompiledHeader>
@@ -1025,7 +1023,6 @@ xcopy /F /I /R /Y "$(OutputPath)$(TargetName).pdb" $(SolutionDir)..\..\..\Lua513
1025 </Command> 1023 </Command>
1026 </PreBuildEvent> 1024 </PreBuildEvent>
1027 <ClCompile> 1025 <ClCompile>
1028 <Optimization>Full</Optimization>
1029 <AdditionalIncludeDirectories>$(SolutionDir)..\..\..\Lua54\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> 1026 <AdditionalIncludeDirectories>$(SolutionDir)..\..\..\Lua54\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
1030 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> 1027 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
1031 <PrecompiledHeader>Use</PrecompiledHeader> 1028 <PrecompiledHeader>Use</PrecompiledHeader>
diff --git a/src/universe.cpp b/src/universe.cpp
index db00b72..89ad02a 100644
--- a/src/universe.cpp
+++ b/src/universe.cpp
@@ -451,7 +451,9 @@ int Universe::UniverseGC(lua_State* const L_)
451 } else { 451 } else {
452 // take the value returned by the finalizer (or our default message) and throw it as an error 452 // take the value returned by the finalizer (or our default message) and throw it as an error
453 // since we are inside Lua's GCTM, it will be propagated through the warning system (Lua 5.4) or swallowed silently 453 // since we are inside Lua's GCTM, it will be propagated through the warning system (Lua 5.4) or swallowed silently
454 raise_lua_error(L_); 454 // IMPORTANT: lua_error() is used here instead of the wrapper raise_lua_error() to circumvent what looks like a MSVC compiler bug
455 // that manifests as a crash inside ntdll!longjmp() function, in optimized builds only
456 lua_error(L_);
455 } 457 }
456 } 458 }
457 459