From 4792d16f17b15a1eca3c2a9c856dc13fda1d23c5 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 5 Jul 2017 13:37:40 +0200 Subject: [PATCH] Fix 698191: don't call pexp with NULL expression in jsdump.c --- jsdump.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jsdump.c b/jsdump.c index 963193a..08347e6 100644 --- a/jsdump.c +++ b/jsdump.c @@ -519,16 +519,16 @@ static void pstm(int d, js_Ast *stm) case STM_FOR: ps("for ("); - pexp(d, stm->a); ps("; "); - pexp(d, stm->b); ps("; "); - pexp(d, stm->c); ps(")"); + if (stm->a) pexp(d, stm->a); ps("; "); + if (stm->b) pexp(d, stm->b); ps("; "); + if (stm->c) pexp(d, stm->c); ps(")"); pstmh(d, stm->d); break; case STM_FOR_VAR: ps("for (var "); pvarlist(d, stm->a); ps("; "); - pexp(d, stm->b); ps("; "); - pexp(d, stm->c); ps(")"); + if (stm->b) pexp(d, stm->b); ps("; "); + if (stm->c) pexp(d, stm->c); ps(")"); pstmh(d, stm->d); break; case STM_FOR_IN: