* src/SDCCast.c (backPatchLabels): fixed bug #1504636
[fw/sdcc] / src / SDCCast.c
index 04d0a63b5af9b25a106cc10e90d296a640991b97..f3ae4175283b5039a973591c53ddbcea72da5e21 100644 (file)
@@ -4794,6 +4794,7 @@ backPatchLabels (ast * tree, symbol * trueLabel, symbol * falseLabel)
   /* while-loops insert a label between the IFX and the condition,
      therefore look behind the label too */
   if (tree->opval.op == LABEL &&
+      tree->right &&
       IS_ANDORNOT (tree->right))
     {
       tree->right = backPatchLabels (tree->right, trueLabel, falseLabel);