Boost logo

Boost-Commit :

From: hartmut.kaiser_at_[hidden]
Date: 2008-07-10 09:43:12


Author: hkaiser
Date: 2008-07-10 09:43:12 EDT (Thu, 10 Jul 2008)
New Revision: 47287
URL: http://svn.boost.org/trac/boost/changeset/47287

Log:
Wave: Fixed ticket #2102
Text files modified:
   branches/release/boost/wave/cpplexer/cpp_lex_token.hpp | 3 ++-
   branches/release/boost/wave/grammars/cpp_expression_grammar.hpp | 14 +++++++++++---
   2 files changed, 13 insertions(+), 4 deletions(-)

Modified: branches/release/boost/wave/cpplexer/cpp_lex_token.hpp
==============================================================================
--- branches/release/boost/wave/cpplexer/cpp_lex_token.hpp (original)
+++ branches/release/boost/wave/cpplexer/cpp_lex_token.hpp 2008-07-10 09:43:12 EDT (Thu, 10 Jul 2008)
@@ -21,6 +21,7 @@
 #include <boost/wave/token_ids.hpp>
 #include <boost/wave/language_support.hpp>
 
+#include <boost/throw_exception.hpp>
 #include <boost/pool/singleton_pool.hpp>
 
 // this must occur after all of the includes and before any code appears
@@ -147,7 +148,7 @@
         
     void *ret = pool_type::malloc();
     if (0 == ret)
- throw std::bad_alloc();
+ boost::throw_exception(std::bad_alloc());
     return ret;
 }
 

Modified: branches/release/boost/wave/grammars/cpp_expression_grammar.hpp
==============================================================================
--- branches/release/boost/wave/grammars/cpp_expression_grammar.hpp (original)
+++ branches/release/boost/wave/grammars/cpp_expression_grammar.hpp 2008-07-10 09:43:12 EDT (Thu, 10 Jul 2008)
@@ -755,7 +755,10 @@
     parse_info<iterator_type> hit(first);
     closure_value result; // expression result
     
- try {
+#if !defined(BOOST_NO_EXCEPTIONS)
+ try
+#endif
+ {
         expression_grammar g; // expression grammar
         hit = parse (first, last, g[spirit_assign_actor(result)],
                      ch_p(T_SPACE) | ch_p(T_CCOMMENT) | ch_p(T_CPPCOMMENT));
@@ -768,6 +771,7 @@
                     expression = "<empty expression>";
                 BOOST_WAVE_THROW(preprocess_exception, ill_formed_expression,
                     expression.c_str(), act_pos);
+ return false;
             }
             else {
             // as the if_block_status is false no errors will be reported
@@ -775,17 +779,20 @@
             }
         }
     }
+#if !defined(BOOST_NO_EXCEPTIONS)
     catch (boost::wave::preprocess_exception const& e) {
     // expression is illformed
         if (if_block_status) {
             boost::throw_exception(e);
+ return false;
         }
- else {
+ else {
         // as the if_block_status is false no errors will be reported
             return false;
         }
     }
-
+#endif
+
     if (!hit.full) {
     // The token list starts with a valid expression, but there remains
     // something. If the remainder consists out of whitespace only, the
@@ -812,6 +819,7 @@
                         expression = "<empty expression>";
                     BOOST_WAVE_THROW(preprocess_exception, ill_formed_expression,
                         expression.c_str(), act_pos);
+ return false;
                 }
                 else {
                 // as the if_block_status is false no errors will be reported


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk