Date: Thu, 15 Sep 2011 10:42:55 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r225579 - stable/7/cddl/contrib/opensolaris/lib/libdtrace/common Message-ID: <201109151042.p8FAgtTr069948@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Thu Sep 15 10:42:55 2011 New Revision: 225579 URL: http://svn.freebsd.org/changeset/base/225579 Log: MFC r209030,209305,209358: In dtrace lexer, do not unput token if it is EOF. PR: kern/159064 On behalf of: kan, marcel Modified: stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Directory Properties: stable/7/cddl/contrib/opensolaris/ (props changed) Modified: stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l ============================================================================== --- stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Thu Sep 15 10:39:44 2011 (r225578) +++ stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Thu Sep 15 10:42:55 2011 (r225579) @@ -45,7 +45,7 @@ #undef input #undef unput #else -/* +/* * Define YY_INPUT for flex since input() can't be re-defined. */ #define YY_INPUT(buf,result,max_size) \ @@ -60,6 +60,19 @@ buf[n] = *yypcb->pcb_strptr++; \ result = n; \ } +/* + * Do not EOF let tokens to be put back. This does not work with flex. + * On the other hand, leaving current buffer in same state it was when + * last EOF was received guarantees that input() will keep returning EOF + * for all subsequent invocations, which is the effect desired. + */ +#undef unput +#define unput(c) \ + do { \ + int _c = c; \ + if (_c != EOF) \ + yyunput(_c, yytext_ptr); \ + } while(0) #endif static int id_or_type(const char *);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109151042.p8FAgtTr069948>