diff options
author | Ori Bernstein <ori@eigenstate.org> | 2016-01-02 15:17:34 -0800 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2016-01-02 15:19:38 -0800 |
commit | 3920112fb1060bed3ebecff443d9887330ef0348 (patch) | |
tree | de8a45db7e7a740515b8ec6292434d07447de671 /mi/cfg.c | |
parent | c2fe43f61c7d2a8277247db8314bb3d5a4ffb753 (diff) | |
download | mc-3920112fb1060bed3ebecff443d9887330ef0348.tar.gz |
Don't double label BBs.
If we've already got a BB with a specific label, don't add
that label again.
Fixes #28
Diffstat (limited to 'mi/cfg.c')
-rw-r--r-- | mi/cfg.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -29,8 +29,10 @@ static Bb *mkbb(Cfg *cfg) static void strlabel(Cfg *cfg, char *lbl, Bb *bb) { - htput(cfg->lblmap, lbl, bb); - lappend(&bb->lbls, &bb->nlbls, lbl); + if (htget(cfg->lblmap, lbl) != bb) { + htput(cfg->lblmap, lbl, bb); + lappend(&bb->lbls, &bb->nlbls, lbl); + } } static void label(Cfg *cfg, Node *lbl, Bb *bb) |