[Groonga-commit] groonga/grnxx at 77559cd [master] Fix wrong error handling.

Back to archive index

susumu.yata null+****@clear*****
Thu Jul 31 19:35:02 JST 2014


susumu.yata	2014-07-31 19:35:02 +0900 (Thu, 31 Jul 2014)

  New Revision: 77559cd8aec155bcd31ef01df6439900567480d6
  https://github.com/groonga/grnxx/commit/77559cd8aec155bcd31ef01df6439900567480d6

  Message:
    Fix wrong error handling.

  Modified files:
    lib/grnxx/expression.cpp

  Modified: lib/grnxx/expression.cpp (+2 -6)
===================================================================
--- lib/grnxx/expression.cpp    2014-07-31 03:28:17 +0900 (cec8a34)
+++ lib/grnxx/expression.cpp    2014-07-31 19:35:02 +0900 (f723eef)
@@ -312,9 +312,7 @@ class UnaryNode : public Node<typename T::Result> {
 
 template <typename T>
 bool UnaryNode<T>::evaluate(Error *error, const RecordSubset &record_set) {
-  try {
-    this->values_.resize(error, record_set.size());
-  } catch (...) {
+  if (!this->values_.resize(error, record_set.size())) {
     GRNXX_ERROR_SET(error, NO_MEMORY, "Memory allocation failed");
     return false;
   }
@@ -502,9 +500,7 @@ class BinaryNode : public Node<typename Op::Result> {
 
 template <typename Op>
 bool BinaryNode<Op>::evaluate(Error *error, const RecordSubset &record_set) {
-  try {
-    this->values_.resize(error, record_set.size());
-  } catch (...) {
+  if (!this->values_.resize(error, record_set.size())) {
     GRNXX_ERROR_SET(error, NO_MEMORY, "Memory allocation failed");
     return false;
   }
-------------- next part --------------
HTML����������������������������...
下載 



More information about the Groonga-commit mailing list
Back to archive index