mirror of
https://github.com/Decompollaborate/rabbitizer.git
synced 2025-02-06 12:40:09 +00:00
Fix disassembly buffer size calculation for very small extraLJust parameters
This commit is contained in:
parent
72b439fe9a
commit
119940e7b4
@ -50,6 +50,9 @@ extern "C" {
|
||||
|
||||
#define ARRAY_COUNT(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||
|
||||
#define RAB_MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define RAB_MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
#define RAB_STRINGIFY2(x) #x
|
||||
#define RAB_STRINGIFY(x) RAB_STRINGIFY2(x)
|
||||
|
||||
|
@ -68,9 +68,14 @@ size_t RabbitizerInstruction_disassembleInstruction(const RabbitizerInstruction
|
||||
|
||||
size_t RabbitizerInstruction_getSizeForBufferDataDisasm(UNUSED const RabbitizerInstruction *self, int extraLJust) {
|
||||
size_t totalSize = 0;
|
||||
int tempLJust;
|
||||
|
||||
totalSize += strlen(".word");
|
||||
totalSize += RabbitizerConfig_Cfg.misc.opcodeLJust + extraLJust;
|
||||
|
||||
tempLJust = RabbitizerConfig_Cfg.misc.opcodeLJust + extraLJust;
|
||||
tempLJust = RAB_MAX(tempLJust, 0);
|
||||
totalSize += tempLJust;
|
||||
|
||||
totalSize += 11;
|
||||
return totalSize;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user