diff options
-rw-r--r-- | filter/decl.m4 | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/filter/decl.m4 b/filter/decl.m4 index 77af84b3..898b298d 100644 --- a/filter/decl.m4 +++ b/filter/decl.m4 @@ -87,10 +87,7 @@ struct f_inst *f_new_inst_]]INST_NAME()[[(enum f_instruction_code fi_code [[m4_undivert(102)]] ) { - struct f_inst *what = cfg_allocz(sizeof(struct f_inst)); - what->fi_code = fi_code; - what->lineno = ifs->lino; - what->size = 1; + struct f_inst *what = fi_new(fi_code); #define whati (&(what->i_]]INST_NAME()[[)) [[m4_undivert(103)]] #undef whati @@ -272,6 +269,16 @@ f_instruction_name(enum f_instruction_code fi) bug("Got unknown instruction code: %d", fi); } +static inline struct f_inst * +fi_new(enum f_instruction_code fi_code) +{ + struct f_inst *what = cfg_allocz(sizeof(struct f_inst)); + what->lineno = ifs->lino; + what->size = 1; + what->fi_code = fi_code; + return what; +} + /* Instruction constructors */ FID_WR_PUT(3) |