summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2008-11-02 12:46:40 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2008-11-02 12:46:40 (GMT)
commit002abd6de66451db160d58cbcb42090bb9356a7c (patch) (side-by-side diff)
tree8feaf71cb64b106e3161bfed77d36ff58c1c8c18
parent40dae974804e364d747254ba942597e3c00612c0 (diff)
downloadmailfromd-002abd6de66451db160d58cbcb42090bb9356a7c.tar.gz
mailfromd-002abd6de66451db160d58cbcb42090bb9356a7c.tar.bz2
Minor fix.
* mfd/drivers.c (mark_type_asgn): Mark variable as referenced if it is assigned a value. git-svn-id: file:///svnroot/mailfromd/trunk@1719 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog5
-rw-r--r--mfd/drivers.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 76796c1..e3d9f53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-11-02 Sergey Poznyakoff <gray@gnu.org.ua>
+ Minor fix.
+
+ * mfd/drivers.c (mark_type_asgn): Mark variable as referenced if
+ it is assigned a value.
+
Get rid of ml_header. Gacopyz takes care about the header
formatting.
diff --git a/mfd/drivers.c b/mfd/drivers.c
index c3ed92b..5ecaad0 100644
--- a/mfd/drivers.c
+++ b/mfd/drivers.c
@@ -1168,9 +1168,13 @@ print_type_asgn(NODE *node, int level)
void
mark_type_asgn(NODE *node)
{
- /* FIXME: That's not quite right. The node should be marked
- only if var is referenced or volatile, but determining this
- would probably require an extra pass. */
+ /* FIXME: This is overly conservative. First of all, `referenced'
+ does not mean `used', so this can create useless assignments,
+ even if the variable in question is not referenced elsewhere: */
+ node->v.asgn.var->flags |= VAR_REFERENCED;
+ /* Secondly, the node should be marked only if var is referenced
+ or volatile, but determining this would probably require an
+ extra pass. */
mark(node->v.asgn.node);
}

Return to:

Send suggestions and report system problems to the System administrator.