From: Mike Taylor Date: Wed, 21 Dec 2005 00:04:14 +0000 (+0000) Subject: Abort when trying to translate a node of unknown type. This happens X-Git-Tag: YAZ.2.1.12~37 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=ccb96652ac7afe10d0cd7db9f0e348001c6b3f82;p=yaz-moved-to-github.git 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 ... --- 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(); } }