From: Robert Bradshaw Date: Fri, 26 Oct 2007 23:16:07 +0000 (-0700) Subject: Fix crash on undeclared builtin X-Git-Tag: 0.9.6.14~29^2~108 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e4d09f3d6335c9947c0e02b6f5097fc1d424e7d5;p=cython.git Fix crash on undeclared builtin --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index cd9b71ff..4c3b5004 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -742,7 +742,7 @@ class NameNode(AtomicExprNode): #print "NameNode.coerce_to:", self.name, dst_type ### if dst_type is py_object_type: entry = self.entry - if entry.is_cfunction: + if entry and entry.is_cfunction: var_entry = entry.as_variable if var_entry: node = NameNode(self.pos, name = self.name) @@ -779,6 +779,9 @@ class NameNode(AtomicExprNode): self.entry = env.lookup(self.name) if not self.entry: self.entry = env.declare_builtin(self.name, self.pos) + if not self.entry: + self.type = PyrexTypes.error_type + return self.analyse_rvalue_entry(env) def analyse_target_types(self, env):