summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-02-25 19:28:36 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-02-25 19:28:36 (GMT)
commit9a7bace1e8afacb3f2be159dafd80b1723f005fd (patch)
tree2e364720399e48a90b2bf084836643430fc32b0d
parent588c206289a84bfc939ac27dacba991d9b6d0793 (diff)
Fixed ARM register comparison.
-rw-r--r--ChangeLog5
-rw-r--r--src/arch/arm/register.c12
2 files changed, 9 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index b40554b..ab2c55a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+17-02-25 Cyrille Bagard <nocbos@gmail.com>
+
+ * src/arch/arm/register.c:
+ Fix ARM register comparison.
+
17-02-19 Cyrille Bagard <nocbos@gmail.com>
* src/analysis/db/certs.c:
diff --git a/src/arch/arm/register.c b/src/arch/arm/register.c
index 3cda075..fc7ecde 100644
--- a/src/arch/arm/register.c
+++ b/src/arch/arm/register.c
@@ -25,6 +25,7 @@
#include "register-int.h"
+#include "../../common/sort.h"
@@ -44,7 +45,7 @@ static void g_arm_register_finalize(GArmRegister *);
static guint g_arm_register_hash(const GArmRegister *);
/* Compare un registre avec un autre. */
-static int g_arm_register_compare(const GArmRegister *, const GArmRegister *);
+static int g_arm_register_compare(const GArmRegister * const *, const GArmRegister * const *);
@@ -188,16 +189,11 @@ static guint g_arm_register_hash(const GArmRegister *reg)
* *
******************************************************************************/
-static int g_arm_register_compare(const GArmRegister *a, const GArmRegister *b)
+static int g_arm_register_compare(const GArmRegister * const *a, const GArmRegister * const *b)
{
int result; /* Bilan à retourner */
- if (a->index < b->index)
- result = -1;
- else if (a->index > b->index)
- result = 1;
- else
- result = 0;
+ result = sort_unsigned_long((*a)->index, (*b)->index);
return result;