aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-08-17 22:25:11 +0200
committerShauren <shauren.trinity@gmail.com>2022-02-02 21:27:52 +0100
commite0ddc676d6c24ce159c71c798069cc6d6ac72b6d (patch)
tree8600fb31e3a7220cf2a0e90fe0f99d663cc7b2b9
parent37777ac6e84041df6ac1b10aca7ff930c4bdb782 (diff)
Scripts/Commands: Move .debug asan command bodies inside #ifdef ASAN
(cherry picked from commit e18f7aaa4d1bc9f6ad4b524c25fd3f111493b774) (cherry picked from commit 0b13fc192698f65cc6e338ef92c22d4d783281b9) (cherry picked from commit 5ecbe93f7d75ea3c4808ce45ccc7d14e1d42b26b)
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 8eb97be1683..e0e2d7edf73 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -1799,19 +1799,23 @@ public:
return true;
};
- static bool HandleDebugOutOfBounds(ChatHandler* handler, CommandArgs* /*args*/)
+ static bool HandleDebugOutOfBounds([[maybe_unused]] ChatHandler* handler, CommandArgs* /*args*/)
{
+#ifdef ASAN
uint8 stack_array[10] = {};
int size = 10;
handler->PSendSysMessage("Triggered an array out of bounds read at address %p, value %u", stack_array + size, stack_array[size]);
+#endif
return true;
}
- static bool HandleDebugMemoryLeak(ChatHandler* handler, CommandArgs* /*args*/)
+ static bool HandleDebugMemoryLeak([[maybe_unused]] ChatHandler* handler)
{
+#ifdef ASAN
uint8* leak = new uint8();
handler->PSendSysMessage("Leaked 1 uint8 object at address %p", leak);
+#endif
return true;
}