Commit 34249751 authored by Robert Bradshaw's avatar Robert Bradshaw

Merge branch 'bugs'

parents 6a526088 0f9fb5fc
...@@ -848,7 +848,7 @@ class CSimpleBaseTypeNode(CBaseTypeNode): ...@@ -848,7 +848,7 @@ class CSimpleBaseTypeNode(CBaseTypeNode):
scope = env scope = env
for item in self.module_path: for item in self.module_path:
entry = scope.lookup(item) entry = scope.lookup(item)
if entry.is_cpp_class: if entry is not None and entry.is_cpp_class:
scope = entry.type.scope scope = entry.type.scope
else: else:
scope = None scope = None
......
...@@ -159,23 +159,13 @@ class TreeVisitor(object): ...@@ -159,23 +159,13 @@ class TreeVisitor(object):
@cython.final @cython.final
def _visit(self, obj): def _visit(self, obj):
try:
handler_method = self.dispatch_table[type(obj)]
except KeyError:
handler_method = self.find_handler(obj)
self.dispatch_table[type(obj)] = handler_method
return handler_method(obj)
@cython.final
def _visitchild(self, child, parent, attrname, idx):
self.access_path.append((parent, attrname, idx))
try: try:
try: try:
handler_method = self.dispatch_table[type(child)] handler_method = self.dispatch_table[type(obj)]
except KeyError: except KeyError:
handler_method = self.find_handler(child) handler_method = self.find_handler(obj)
self.dispatch_table[type(child)] = handler_method self.dispatch_table[type(obj)] = handler_method
result = handler_method(child) return handler_method(obj)
except Errors.CompileError: except Errors.CompileError:
raise raise
except Errors.AbortError: except Errors.AbortError:
...@@ -183,7 +173,12 @@ class TreeVisitor(object): ...@@ -183,7 +173,12 @@ class TreeVisitor(object):
except Exception, e: except Exception, e:
if DebugFlags.debug_no_exception_intercept: if DebugFlags.debug_no_exception_intercept:
raise raise
self._raise_compiler_error(child, e) self._raise_compiler_error(obj, e)
@cython.final
def _visitchild(self, child, parent, attrname, idx):
self.access_path.append((parent, attrname, idx))
result = self._visit(child)
self.access_path.pop() self.access_path.pop()
return result return result
......
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