summaryrefslogtreecommitdiff
path: root/src/format
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-04-20 18:52:01 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-04-20 18:52:01 (GMT)
commit8e5c8417e8ef79c1b475cb1b86a1754b24f9af78 (patch)
tree650a39bde7a5367995b471a562aa766febd505bc /src/format
parentc177597d6da5dedb32aa176e8370db8ffb7f87aa (diff)
Shared immediate operands in order to avoid useless allocations.
Diffstat (limited to 'src/format')
-rw-r--r--src/format/symbol.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/format/symbol.h b/src/format/symbol.h
index 7389195..d5c9a79 100644
--- a/src/format/symbol.h
+++ b/src/format/symbol.h
@@ -133,13 +133,15 @@ GDbComment *g_binary_symbol_get_comment(const GBinSymbol *);
* Confort pour l'ajout de symboles basés sur des formats.
*/
-#define SET_IMM_DISPLAY(_ins, _op, _idx, _dsp) \
- do \
- { \
- _op = g_arch_instruction_get_operand(_ins, _idx); \
- g_imm_operand_set_default_display(G_IMM_OPERAND(_op), _dsp); \
- g_imm_operand_set_display(G_IMM_OPERAND(_op), _dsp); \
- } \
+#define SET_IMM_DISPLAY(_ins, _op, _idx, _dsp) \
+ do \
+ { \
+ GImmOperand *_imm; \
+ _imm = G_IMM_OPERAND(g_arch_instruction_get_operand(_ins, _idx)); \
+ g_imm_operand_set_default_display(&_imm, _dsp, G_SHARE_CONTAINER(_ins)); \
+ g_imm_operand_set_display(&_imm, _dsp, G_SHARE_CONTAINER(_ins)); \
+ _op = G_ARCH_OPERAND(_imm); \
+ } \
while (0)
#define ADD_RAW_AS_SYM(_fmt, _sym, _ins, _cmt, _txt) \