From b9037c70e3764300cac0710e987f0bc29245df8d Mon Sep 17 00:00:00 2001 From: angie <angheloalf95@gmail.com> Date: Fri, 16 Sep 2022 14:51:05 -0300 Subject: [PATCH] Avoid not fitting value on LoPairingInfo --- include/analysis/RabbitizerLoPairingInfo.h | 2 +- rabbitizer/rabbitizer_type_LoPairingInfo.c | 2 +- src/analysis/RabbitizerTrackedRegisterState.c | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/analysis/RabbitizerLoPairingInfo.h b/include/analysis/RabbitizerLoPairingInfo.h index ba66744..1d4fa50 100644 --- a/include/analysis/RabbitizerLoPairingInfo.h +++ b/include/analysis/RabbitizerLoPairingInfo.h @@ -12,7 +12,7 @@ typedef struct RabbitizerLoPairingInfo { int instrOffset; - int value; + int64_t value; // could be either an unsigned 32 bits number or a signed one, so use 64 bits to ensure it fits bool shouldProcess; bool isGpRel; bool isGpGot; diff --git a/rabbitizer/rabbitizer_type_LoPairingInfo.c b/rabbitizer/rabbitizer_type_LoPairingInfo.c index c22e906..5a9c62c 100644 --- a/rabbitizer/rabbitizer_type_LoPairingInfo.c +++ b/rabbitizer/rabbitizer_type_LoPairingInfo.c @@ -23,7 +23,7 @@ static int rabbitizer_type_LoPairingInfo_init(PyRabbitizerLoPairingInfo *self, P static PyMemberDef rabbitizer_type_LoPairingInfo_members[] = { { "instrOffset", T_INT, offsetof(PyRabbitizerLoPairingInfo, pairingInfo.instrOffset), 0, "" }, - { "value", T_INT, offsetof(PyRabbitizerLoPairingInfo, pairingInfo.value), 0, "" }, + { "value", T_LONG, offsetof(PyRabbitizerLoPairingInfo, pairingInfo.value), 0, "" }, { "shouldProcess", T_BOOL, offsetof(PyRabbitizerLoPairingInfo, pairingInfo.shouldProcess), 0, "" }, { "isGpRel", T_BOOL, offsetof(PyRabbitizerLoPairingInfo, pairingInfo.isGpRel), 0, "" }, { "isGpGot", T_BOOL, offsetof(PyRabbitizerLoPairingInfo, pairingInfo.isGpGot), 0, "" }, diff --git a/src/analysis/RabbitizerTrackedRegisterState.c b/src/analysis/RabbitizerTrackedRegisterState.c index 4bbb971..bee1d69 100644 --- a/src/analysis/RabbitizerTrackedRegisterState.c +++ b/src/analysis/RabbitizerTrackedRegisterState.c @@ -61,7 +61,6 @@ void RabbitizerTrackedRegisterState_clearLo(RabbitizerTrackedRegisterState *self self->loOffset = 0; self->dereferenced = false; self->dereferenceOffset = 0; - self->value = 0; } void RabbitizerTrackedRegisterState_copyState(RabbitizerTrackedRegisterState *self, const RabbitizerTrackedRegisterState *other) {