diff options
author | Karel Kočí <cynerd@email.cz> | 2015-05-01 22:40:16 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-05-01 22:40:16 +0200 |
commit | a8694ad53dbaf72232398d33e0a94328041c6a1b (patch) | |
tree | c5e41bb9ad93822b7a40f964a286a25be9c91bb2 /scripts/parse_kconfig | |
parent | 5ddb073d8ffb9b2fc641e782acdfacf67fda179f (diff) | |
download | linux-conf-perf-a8694ad53dbaf72232398d33e0a94328041c6a1b.tar.gz linux-conf-perf-a8694ad53dbaf72232398d33e0a94328041c6a1b.tar.bz2 linux-conf-perf-a8694ad53dbaf72232398d33e0a94328041c6a1b.zip |
parse_kconfig fix boolexpr_not
Diffstat (limited to 'scripts/parse_kconfig')
-rw-r--r-- | scripts/parse_kconfig/boolexpr.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/scripts/parse_kconfig/boolexpr.c b/scripts/parse_kconfig/boolexpr.c index d29d238..ccd7cef 100644 --- a/scripts/parse_kconfig/boolexpr.c +++ b/scripts/parse_kconfig/boolexpr.c @@ -212,22 +212,25 @@ struct boolexpr *boolexpr_and(struct boolexpr *e1, struct boolexpr *e2) { } struct boolexpr *boolexpr_not(struct boolexpr *e) { + struct boolexpr *rtn; + rtn = malloc(sizeof(struct boolexpr)); + rtn->overusage = 0; + rtn->id = 0; + switch (e->type) { case BT_FALSE: - e->type = BT_TRUE; - return e; + rtn->type = BT_TRUE; + boolexpr_free(e); + break; case BT_TRUE: - e->type = BT_FALSE; - return e; + rtn->type = BT_FALSE; + boolexpr_free(e); + break; default: + rtn->type = BT_NOT; + rtn->left = e; break; } - struct boolexpr *rtn; - rtn = malloc(sizeof(struct boolexpr)); - rtn->type = BT_NOT; - rtn->overusage = 0; - rtn->id = 0; - rtn->left = e; return rtn; } |