From ccb96652ac7afe10d0cd7db9f0e348001c6b3f82 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 21 Dec 2005 00:04:14 +0000 Subject: [PATCH] Abort when trying to translate a node of unknown type. This happens when (for example) the node is corrupted by its parser being freed before it's passed into the translation function ... a classic C-style bug that's taken much of this evening to find and fix. Defensive programming, guys ... --- src/cqltransform.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cqltransform.c b/src/cqltransform.c index 70c45e7..a203f61 100644 --- a/src/cqltransform.c +++ b/src/cqltransform.c @@ -1,4 +1,4 @@ -/* $Id: cqltransform.c,v 1.16 2005-06-27 22:03:59 adam Exp $ +/* $Id: cqltransform.c,v 1.17 2005-12-21 00:04:14 mike Exp $ Copyright (C) 1995-2005, Index Data ApS Index Data Aps @@ -446,6 +446,10 @@ void cql_transform_r(cql_transform_t ct, cql_transform_r(ct, cn->u.boolean.left, pr, client_data); cql_transform_r(ct, cn->u.boolean.right, pr, client_data); + + default: + fprintf(stderr, "Fatal: impossible CQL node-type %d\n", cn->which); + abort(); } } -- 1.7.10.4