aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-04-04 06:25:24 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-05-06 16:04:59 +0200
commit31059faedd34bdbad6eb45ca6dce7714c12626cc (patch)
tree1e2008a9d7b7bb623093e56ff940893309cd25ea
parent34c827db37e98c40f35ff74bcffd3ea21f0cf2b0 (diff)
downloadsparse-dev-31059faedd34bdbad6eb45ca6dce7714c12626cc.tar.gz
OP_SYMADDR is simply an unop
Currently OP_SYMADDR are defined the same as OP_SETVAL. However, OP_SYMADDRs don't need the field 'struct expression *val' and OP_SETVALs don't need the field 'pseudo_t symbol' which suggest that those two should be splitted. In fact, OP_SYMADDR, having just one pseudo as operand and producing one pseudo, is simply an unary op like OP_NOT, OP_NEG, ... Change this by letting OP_SYMADDRs use the field 'src' as the others unops do. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--linearize.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/linearize.h b/linearize.h
index 8790b7e5..db4a67f3 100644
--- a/linearize.h
+++ b/linearize.h
@@ -117,8 +117,10 @@ struct instruction {
pseudo_t base;
unsigned from, len;
};
- struct /* setval and symaddr */ {
+ struct /* symaddr */ {
pseudo_t symbol; /* Subtle: same offset as "src" !! */
+ };
+ struct /* setval */ {
struct expression *val;
};
struct /* setfval */ {