diff options
| author | 2018-09-12 04:51:41 -0400 | |
|---|---|---|
| committer | 2018-09-12 04:51:44 -0400 | |
| commit | 9b3bc0b282393a9bf19b4bcb1c2830a879278fbf (patch) | |
| tree | bca820ac25a5405a9a1409b082fac6eca397a5b1 /src | |
| parent | svc: Correct parameter type for OutputDebugString() (diff) | |
| download | yuzu-9b3bc0b282393a9bf19b4bcb1c2830a879278fbf.tar.gz yuzu-9b3bc0b282393a9bf19b4bcb1c2830a879278fbf.tar.xz yuzu-9b3bc0b282393a9bf19b4bcb1c2830a879278fbf.zip | |
svc: Do nothing if svcOutputDebugString() is given a length of zero
While unlikely, it does avoid constructing a std::string and
unnecessarily calling into the memory code if a game or executable
decides to be really silly about their logging.
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 07a6c4014..0b2a7e3cb 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -274,6 +274,10 @@ static void Break(u64 reason, u64 info1, u64 info2) { | |||
| 274 | 274 | ||
| 275 | /// Used to output a message on a debug hardware unit - does nothing on a retail unit | 275 | /// Used to output a message on a debug hardware unit - does nothing on a retail unit |
| 276 | static void OutputDebugString(VAddr address, u64 len) { | 276 | static void OutputDebugString(VAddr address, u64 len) { |
| 277 | if (len == 0) { | ||
| 278 | return; | ||
| 279 | } | ||
| 280 | |||
| 277 | std::string str(len, '\0'); | 281 | std::string str(len, '\0'); |
| 278 | Memory::ReadBlock(address, str.data(), str.size()); | 282 | Memory::ReadBlock(address, str.data(), str.size()); |
| 279 | LOG_DEBUG(Debug_Emulated, "{}", str); | 283 | LOG_DEBUG(Debug_Emulated, "{}", str); |