merge
authorRobert Bradshaw <robertwb@math.washington.edu>
Sat, 4 Jul 2009 07:59:03 +0000 (00:59 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sat, 4 Jul 2009 07:59:03 +0000 (00:59 -0700)
1  2 
Cython/Compiler/Nodes.py

index 19790c361f89ec9e5019b84635b2f0538938f7d5,9d37dfbeaff67cd43a1c30226ce1482236d58ca8..7b0539aaafe7fd9da33f6397e679be5885808022
@@@ -3386,23 -3386,22 +3386,25 @@@ class DelStatNode(StatNode)
      def analyse_expressions(self, env):
          for arg in self.args:
              arg.analyse_target_expression(env, None)
 -            if arg.type.is_pyobject or (arg.type.is_ptr and arg.type.base_type.is_cpp_class):
 +            if arg.type.is_pyobject:
                  self.gil_check(env)
 -                error(arg.pos, "Deletion of static C++ object")
 +            elif arg.type.is_ptr and arg.type.base_type.is_cpp_class:
 +                pass
+             elif arg.type.is_cpp_class:
++                error(arg.pos, "Deletion of non-heap C++ object")
              else:
 -                error(arg.pos, "Deletion of non-Python object")
 +                error(arg.pos, "Deletion of non-Python, non-C++ object")
              #arg.release_target_temp(env)
  
 -    gil_message = "Deleting Python object or C++ dynamic object"
 +    gil_message = "Deleting Python object"
  
      def generate_execution_code(self, code):
          for arg in self.args:
              if arg.type.is_pyobject:
                  arg.generate_deletion_code(code)
              elif arg.type.is_ptr and arg.type.base_type.is_cpp_class:
 -                code.putln("delete %s;" % arg.name)
 +                arg.generate_result_code()
-                 code.putln("delete %s" % arg.result())
++                code.putln("delete %s;" % arg.result())
              # else error reported earlier
  
      def annotate(self, code):