Commit 7a57ab27 authored by Stefan Behnel's avatar Stefan Behnel

fix compiler crash due to uninitialised attribute

parent 26462a2a
......@@ -11330,6 +11330,7 @@ class PrimaryCmpNode(ExprNode, CmpNode):
def analyse_cpp_comparison(self, env):
type1 = self.operand1.type
type2 = self.operand2.type
self.is_pycmp = False
entry = env.lookup_operator(self.operator, [self.operand1, self.operand2])
if entry is None:
error(self.pos, "Invalid types for '%s' (%s, %s)" %
......@@ -11345,7 +11346,6 @@ class PrimaryCmpNode(ExprNode, CmpNode):
else:
self.operand1 = self.operand1.coerce_to(func_type.args[0].type, env)
self.operand2 = self.operand2.coerce_to(func_type.args[1].type, env)
self.is_pycmp = False
self.type = func_type.return_type
def analyse_memoryviewslice_comparison(self, env):
......
# mode: error
# tag: cpp
from libcpp.vector cimport vector
def vector_is_none(vector[int] iv):
# TODO: this isn't strictly wrong, so it might be allowed as a 'feature' at some point
if iv is None:
pass
_ERRORS = """
8:10: Invalid types for 'is' (vector[int], Python object)
"""
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment