WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] libxl: correctly initialise yylineno

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: correctly initialise yylineno
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Fri, 04 Mar 2011 17:05:28 +0000
Delivery-date: Fri, 04 Mar 2011 09:05:57 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1299172291 0
# Node ID e567c2eb56b431d83c9355e4db786a88c10d3522
# Parent  a5f8fb109610f8c4f55ef62a787f2b75200a4aab
libxl: correctly initialise yylineno

Sometimes xl would read an uninitialised variable when printing error
messages, resulting in things like this:
  /etc/xen/thing.cfg:1030057088: config parsing error near `"ws08r2-x64-2': 
lexical error

This is because yylineno is a variable inside the scanner created by
yylex_init, but it is not initialised by yylex_init.
(Debian bug #616099.)

On the way I discovered a lot of complication to do with the calling
convention between bison and flex in reentrant parsers/scanners which
use locations (Debian bug #616100) but as the above change makes the
current code in xen-unstable work I don't propose to do anything else
about that now in our tree.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Tested-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r a5f8fb109610 -r e567c2eb56b4 tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c  Thu Mar 03 17:07:40 2011 +0000
+++ b/tools/libxl/libxlu_cfg.c  Thu Mar 03 17:11:31 2011 +0000
@@ -43,6 +43,9 @@
 static void parse(CfgParseContext *ctx) {
     /* On return, ctx.err will be updated with the error status. */
     int r;
+
+    xlu__cfg_yyset_lineno(1, ctx->scanner);
+
     r= xlu__cfg_yyparse(ctx);
     if (r) assert(ctx->err);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: correctly initialise yylineno, Xen patchbot-unstable <=