help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

std::string as YYSTYPE segfaults


From: Magnus Ekhall
Subject: std::string as YYSTYPE segfaults
Date: Thu, 28 Feb 2002 16:20:00 +0100

Hi!

I'm using Flex with Bison, and having some trouble passing strings from
Flex to Bison.
I know that Flex only points to a temporary buffer, so I have defined
YYSTYPE to be std::String.
In my Flex file I write:

TOKEN       {yylval = string(yytext, yyleng); return TOKEN;}
etc

It works for a number of tokens, but then I get a segmentation fault:
"
in basic_string<char, string_char_traits<char>,
__default_alloc_template<false, 0> >::Rep::release (this=0xfffffff0)
"

Does anyone know why? And maybe a way to get around the problem?

/
Magnus E




reply via email to

[Prev in Thread] Current Thread [Next in Thread]