Commit e4d09f3d authored by Robert Bradshaw's avatar Robert Bradshaw

Fix crash on undeclared builtin

parent 83e6c759
...@@ -742,7 +742,7 @@ class NameNode(AtomicExprNode): ...@@ -742,7 +742,7 @@ class NameNode(AtomicExprNode):
#print "NameNode.coerce_to:", self.name, dst_type ### #print "NameNode.coerce_to:", self.name, dst_type ###
if dst_type is py_object_type: if dst_type is py_object_type:
entry = self.entry entry = self.entry
if entry.is_cfunction: if entry and entry.is_cfunction:
var_entry = entry.as_variable var_entry = entry.as_variable
if var_entry: if var_entry:
node = NameNode(self.pos, name = self.name) node = NameNode(self.pos, name = self.name)
...@@ -779,6 +779,9 @@ class NameNode(AtomicExprNode): ...@@ -779,6 +779,9 @@ class NameNode(AtomicExprNode):
self.entry = env.lookup(self.name) self.entry = env.lookup(self.name)
if not self.entry: if not self.entry:
self.entry = env.declare_builtin(self.name, self.pos) self.entry = env.declare_builtin(self.name, self.pos)
if not self.entry:
self.type = PyrexTypes.error_type
return
self.analyse_rvalue_entry(env) self.analyse_rvalue_entry(env)
def analyse_target_types(self, env): def analyse_target_types(self, env):
......
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