Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2004-12-13 14:40:17


Support Requests item #1084615, was opened at 2004-12-13 20:40
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=207586&aid=1084615&group_id=7586

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Alessio Marchetti (bnf)
Assigned to: Nobody/Anonymous (nobody)
Summary: spirit: run-time error

Initial Comment:
I am using the Spirit library v1.8.1, part of Boost 1.32.
Here is a test case which fails at run-time: I get a
VC++ Debug Library Error in file
core\non-terminal\impl\rule.ipp at line 173.
My compiler is VC++ 7.1 on Windows XP SP2.
In particular I get a Run-Time Check Failure #2: Stack
around the variable 'context-wrap' was corrupted.

Any idea about what can be the problem?
Please note that with the following I don't get any error:

    definition(const JSIGrammar& self)
    {
      Rule_T pp_token = real_p
      r = ch_p('#') >> str_p("line") >> +(pp_token);
    }

struct JSIGrammar : public grammar<JSIGrammar>
{
  template <typename ScannerT>
  struct definition
  {
    typedef rule<ScannerT> Rule_T;
    
    definition(const JSIGrammar& self)
    {
      Rule_T pp_number = real_p;
      Rule_T pp_token = pp_number;
      r = ch_p('#') >> str_p("line") >> +(pp_token);
    }

    const Rule_T& start() const
    {
      return r;
    }

    Rule_T r;
  };
};

int
main(int argc, char* argv[])
{
  string str;
  {
    ifstream in(argv[1]);
    ostringstream out;
    out << in.rdbuf();
    str = out.str();
  }

  typedef parse_info<string::iterator> Info;

  JSIGrammar g;
  Info pi = parse(str.begin(), str.end(), g, space_p);
  
  if ( pi.hit )
  {
    cout << "Match" << endl;
    cout << "Full: " << (pi.full ? "Yes" : "No") << endl;
    cout << "Length: " << pi.length << endl;
  }
  else
  {
    cout << "No match" << endl;
  }
  
  return 0;
}

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=207586&aid=1084615&group_id=7586

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk