]> git.draconx.ca Git - cdecl99.git/commitdiff
Abort on "impossible" condition.
authorNick Bowler <nbowler@draconx.ca>
Sun, 11 Sep 2011 23:27:44 +0000 (19:27 -0400)
committerNick Bowler <nbowler@draconx.ca>
Sun, 11 Sep 2011 23:27:44 +0000 (19:27 -0400)
A corrupt or otherwise invalid cdecl structure could make the
explain_prologue function fail to return a value.  Add an assertion to
catch that.

src/explain.c

index 41d4f7be744c4ce23de7adbbe6ed9a6d9dc33b62..d50e45e208a3d171588bcbdcf58f7e2734e2f505 100644 (file)
@@ -48,6 +48,8 @@ explain_prologue(char *buf, size_t n, struct cdecl_declarator *d, bool top)
 
                d = d->child;
        }
+
+       assert(0);
 }
 
 static size_t