From 585a2f345be7f58a6811f0eceda8c2b39e103deb Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Sun, 10 Jan 2016 14:55:03 +0100 Subject: Fixed a bug when the replacing string contains the replaced pattern. --- ChangeLog | 11 +++++++++++ src/common/extstr.c | 2 ++ src/format/format.c | 2 ++ tools/d2c/rules.c | 2 ++ 4 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4fc256d..a6aa27c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +16-01-10 Cyrille Bagard + + * src/common/extstr.c: + Fix a bug when the replacing string contains the replaced pattern. + + * src/format/format.c: + Remove a compilation warning when the debug mode is disabled. + + * tools/d2c/rules.c: + Disable the SEE rule in the compiler. + 16-01-04 Cyrille Bagard * src/analysis/disass/area.c: diff --git a/src/common/extstr.c b/src/common/extstr.c index 59d4389..9986ec1 100644 --- a/src/common/extstr.c +++ b/src/common/extstr.c @@ -209,6 +209,8 @@ char *strrpl(char *haystack, const char *needle1, const char *needle2) memcpy(found, needle2, len2); + index += len2; + } return haystack; diff --git a/src/format/format.c b/src/format/format.c index dd70281..8395c6e 100644 --- a/src/format/format.c +++ b/src/format/format.c @@ -232,8 +232,10 @@ void g_binary_format_setup_disassembling_context(const GBinFormat *format, GProc void _g_binary_format_add_symbol(GBinFormat *format, GBinSymbol *symbol, bool sort) { +#ifndef NDEBUG const mrange_t *range; /* Couverture du symbole */ const vmpa2t *addr; /* Emplacement du symbole */ +#endif /** * Lorsque les fonctions de recherche type g_binary_format_find_symbol_at() diff --git a/tools/d2c/rules.c b/tools/d2c/rules.c index 3101727..d527454 100644 --- a/tools/d2c/rules.c +++ b/tools/d2c/rules.c @@ -468,6 +468,7 @@ bool write_decoding_rules(decoding_rules *rules, CondActionType filter, int fd, { case CAT_SEE: +#if 0 dprintf(fd, "\t\t\tinstr = %s_read_%sinstr_%s", arch, subarch, rule->action.details); /* TODO : adapter les paramètres d'appel selon le 'coder' */ @@ -476,6 +477,7 @@ bool write_decoding_rules(decoding_rules *rules, CondActionType filter, int fd, dprintf(fd, "\t\t\tgoto quick_exit;\n"); *exit = true; +#endif break; case CAT_UNPREDICTABLE: -- cgit v0.11.2-87-g4458