-
Notifications
You must be signed in to change notification settings - Fork 16
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
Updated dissasm view: fixed offsets and added caching + some misc improvements #351
Conversation
rzaharia
commented
Oct 26, 2024
- fixed Dissasm bug when some offsets would be shown incorrectly
- added caching file for Dissasm where it stores comments and annotations
const auto* dissasmZone = (DissasmCodeZone*) zone.get(); | ||
if (!dissasmZone->ToBuffer(buffer)) | ||
return; | ||
zoneName.SetFormat("DissasmParseZoneType.%llu", zone->startLineIndex); |
Check failure
Code scanning / CodeQL
Wrong type of arguments to formatting function High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 29 days ago
To fix the problem, we need to ensure that the format specifier matches the type of the variable being formatted. Since startLineIndex
is of type unsigned int
, the correct format specifier should be %u
instead of %llu
.
- Change the format specifier in the
SetFormat
method call from%llu
to%u
to match theunsigned int
type ofstartLineIndex
. - This change should be made in the file
GViewCore/src/View/DissasmViewer/DissasmCache.cpp
on line 170.
-
Copy modified line R170 -
Copy modified line R186
@@ -169,3 +169,3 @@ | ||
return; | ||
zoneName.SetFormat("DissasmParseZoneType.%llu", zone->startLineIndex); | ||
zoneName.SetFormat("DissasmParseZoneType.%u", zone->startLineIndex); | ||
if (!cacheData.AddRegion(zoneName.GetText(), buffer.data(), (uint32) buffer.size())) | ||
@@ -185,3 +185,3 @@ | ||
return false; | ||
zoneName.SetFormat("DisassemblyZone.%llu", start); | ||
zoneName.SetFormat("DisassemblyZone.%u", start); | ||
if (!cache.AddRegion(zoneName.GetText(), buffer.data(), (uint32) buffer.size())) |
if (zoneType != DissasmParseZoneType::DissasmCodeParseZone) | ||
return false; | ||
LocalString<64> zoneName; | ||
zoneName.SetFormat("DissasmParseZoneType.%llu", startLineIndex); |
Check failure
Code scanning / CodeQL
Wrong type of arguments to formatting function High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 29 days ago
To fix the problem, we need to ensure that the format specifier matches the type of startLineIndex
. Since startLineIndex
is of type unsigned int
, the correct format specifier to use is %u
. This change will ensure that the printf
function interprets the argument correctly, preventing any undefined behavior.
-
Copy modified line R259
@@ -258,3 +258,3 @@ | ||
LocalString<64> zoneName; | ||
zoneName.SetFormat("DissasmParseZoneType.%llu", startLineIndex); | ||
zoneName.SetFormat("DissasmParseZoneType.%u", startLineIndex); | ||
|