commit: 1456ed9d7c8e4af57ac9de21e281671e1cfad7ab
parent be352dc128667288947beda05adbe20f7d847cbe
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 8 Sep 2024 10:05:34 +0200
cmd/expr.y: assert non-NULL result
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/cmd/expr.y b/cmd/expr.y
@@ -15,6 +15,7 @@
* #include <stdlib.h>
*/
+#include <assert.h>
#include <sys/types.h>
#include <ctype.h>
#include <err.h>
@@ -303,6 +304,7 @@ main(int argc, char *argv[])
yyparse();
+ assert(result);
if (result->type == integer)
printf("%jd\n", result->u.i);
else