diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-06-19 18:08:49 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-06-19 18:08:49 (GMT) |
commit | 9b7924c7c5d97f83f589f4e185cfabe971f72bc4 (patch) | |
tree | a6a2ec54962534f420c0d3970645390589488d2d | |
parent | 85c7e2921dc28d78b9c1882af78f88e9ce956fca (diff) |
Avoided to cache ARMv7 instruction keyword when unneeded.
-rw-r--r-- | plugins/arm/v7/instruction.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/arm/v7/instruction.c b/plugins/arm/v7/instruction.c index 9eb43ac..ee75efd 100644 --- a/plugins/arm/v7/instruction.c +++ b/plugins/arm/v7/instruction.c @@ -299,18 +299,22 @@ static const char *g_armv7_instruction_get_keyword(const GArmV7Instruction *inst parent = G_ARM_INSTRUCTION(instr); - if (parent->cached_keyword == NULL) - { - assert(instr->sid < AOP7_ENC_COUNT); + assert(instr->sid < AOP7_ENC_COUNT); - parent->cached_keyword = strdup(_armv7_keywords[instr->sid]); + if (parent->suffix == NULL) + result = _armv7_keywords[instr->sid]; - if (parent->suffix != NULL) + else + { + if (parent->cached_keyword == NULL) + { + parent->cached_keyword = strdup(_armv7_keywords[instr->sid]); parent->cached_keyword = stradd(parent->cached_keyword, parent->suffix); + } - } + result = parent->cached_keyword; - result = parent->cached_keyword; + } return result; |