From 8865194e47b0c40392e1b40f158bd1bfeb7e6134 Mon Sep 17 00:00:00 2001 From: Nikita Edel Date: Tue, 10 Mar 2026 21:59:51 +0100 Subject: [PATCH] uninitialized data --- Minecraft.Client/Platform/Common/UI/UIGroup.cpp | 5 +++-- debug.sh | 7 +++++++ run.sh | 7 +++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100755 debug.sh create mode 100755 run.sh diff --git a/Minecraft.Client/Platform/Common/UI/UIGroup.cpp b/Minecraft.Client/Platform/Common/UI/UIGroup.cpp index fbf76d20e..996d1f94d 100644 --- a/Minecraft.Client/Platform/Common/UI/UIGroup.cpp +++ b/Minecraft.Client/Platform/Common/UI/UIGroup.cpp @@ -10,6 +10,9 @@ UIGroup::UIGroup(EUIGroup group, int iPad) m_bContainerMenuDisplayed = false; m_bIgnoreAutosaveMenuDisplayed = false; m_bIgnorePlayerJoinMenuDisplayed = false; + // 4jcraft, moved this to the top + // initialized memory was read. + m_viewportType = C4JRender::VIEWPORT_TYPE_FULLSCREEN; m_updateFocusStateCountdown = 0; @@ -39,8 +42,6 @@ UIGroup::UIGroup(EUIGroup group, int iPad) m_pressStartToPlay = (UIComponent_PressStartToPlay *)m_layers[(int)eUILayer_Tooltips]->addComponent(0, eUIComponent_PressStartToPlay); } - m_viewportType = C4JRender::VIEWPORT_TYPE_FULLSCREEN; - // 4J Stu - Pre-allocate this for cached rendering in scenes. It's horribly slow to do dynamically, but we should only need one // per group as we will only be displaying one of these types of scenes at a time m_commandBufferList = MemoryTracker::genLists(1); diff --git a/debug.sh b/debug.sh new file mode 100755 index 000000000..e2d2bc292 --- /dev/null +++ b/debug.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +meson setup build -Db_sanitize=address,leak,undefined -Dcpp_args=-fno-sanitize-recover=all -Dc_args=-fno-sanitize-recover=all && \ +meson compile -C build && \ +cd build/Minecraft.Client/ && \ +gdb -tui ./Minecraft.Client && \ +cd ../.. diff --git a/run.sh b/run.sh new file mode 100755 index 000000000..bd0a0c27b --- /dev/null +++ b/run.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +meson setup build -Db_sanitize=address,leak,undefined -Dcpp_args=-fno-sanitize-recover=all -Dc_args=-fno-sanitize-recover=all && \ +meson compile -C build && \ +cd build/Minecraft.Client/ && \ +UBSAN_OPTIONS=print_stacktrace=1 ./Minecraft.Client && \ +cd ../..