Mercurial > hg > index.cgi
comparison lwasm/insn_rel.c @ 89:651b85a98c1b
Fixed memory leaks revealed by valgrind
author | lost@l-w.ca |
---|---|
date | Wed, 22 Jun 2011 18:57:59 -0600 |
parents | 7317fbe024af |
children | 95181f1ad183 |
comparison
equal
deleted
inserted
replaced
88:1a1fdfe860d0 | 89:651b85a98c1b |
---|---|
50 e1 = lw_expr_build(lw_expr_type_special, lwasm_expr_linelen, l); | 50 e1 = lw_expr_build(lw_expr_type_special, lwasm_expr_linelen, l); |
51 e2 = lw_expr_build(lw_expr_type_oper, lw_expr_oper_plus, e1, l -> addr); | 51 e2 = lw_expr_build(lw_expr_type_oper, lw_expr_oper_plus, e1, l -> addr); |
52 lw_expr_destroy(e1); | 52 lw_expr_destroy(e1); |
53 e1 = lw_expr_build(lw_expr_type_oper, lw_expr_oper_minus, t, e2); | 53 e1 = lw_expr_build(lw_expr_type_oper, lw_expr_oper_minus, t, e2); |
54 lw_expr_destroy(e2); | 54 lw_expr_destroy(e2); |
55 lw_expr_destroy(t); | |
55 lwasm_save_expr(l, 0, e1); | 56 lwasm_save_expr(l, 0, e1); |
56 } | 57 } |
57 | 58 |
58 EMITFUNC(insn_emit_rel8) | 59 EMITFUNC(insn_emit_rel8) |
59 { | 60 { |
99 e1 = lw_expr_build(lw_expr_type_special, lwasm_expr_linelen, l); | 100 e1 = lw_expr_build(lw_expr_type_special, lwasm_expr_linelen, l); |
100 e2 = lw_expr_build(lw_expr_type_oper, lw_expr_oper_plus, e1, l -> addr); | 101 e2 = lw_expr_build(lw_expr_type_oper, lw_expr_oper_plus, e1, l -> addr); |
101 lw_expr_destroy(e1); | 102 lw_expr_destroy(e1); |
102 e1 = lw_expr_build(lw_expr_type_oper, lw_expr_oper_minus, t, e2); | 103 e1 = lw_expr_build(lw_expr_type_oper, lw_expr_oper_minus, t, e2); |
103 lw_expr_destroy(e2); | 104 lw_expr_destroy(e2); |
105 lw_expr_destroy(t); | |
104 lwasm_save_expr(l, 0, e1); | 106 lwasm_save_expr(l, 0, e1); |
105 } | 107 } |
106 | 108 |
107 EMITFUNC(insn_emit_rel16) | 109 EMITFUNC(insn_emit_rel16) |
108 { | 110 { |