[pypy-svn] r13483 - in pypy/dist/pypy: annotation rpython
arigo at codespeak.net
arigo at codespeak.net
Thu Jun 16 18:18:13 CEST 2005
Author: arigo
Date: Thu Jun 16 18:18:10 2005
New Revision: 13483
Modified:
pypy/dist/pypy/annotation/classdef.py
pypy/dist/pypy/rpython/rclass.py
pypy/dist/pypy/rpython/rmodel.py
Log:
Pointer typing bug fix.
Fixed a possible crash of classdef.commonbase(None).
Modified: pypy/dist/pypy/annotation/classdef.py
==============================================================================
--- pypy/dist/pypy/annotation/classdef.py (original)
+++ pypy/dist/pypy/annotation/classdef.py Thu Jun 16 18:18:10 2005
@@ -154,7 +154,7 @@
while other is not None and not issubclass(self.cls, other.cls):
other = other.basedef
# special case for MI with Exception
- if not other:
+ if other is None and other1 is not None:
if issubclass(self.cls, Exception) and issubclass(other1.cls, Exception):
return self.bookkeeper.getclassdef(Exception)
return other
Modified: pypy/dist/pypy/rpython/rclass.py
==============================================================================
--- pypy/dist/pypy/rpython/rclass.py (original)
+++ pypy/dist/pypy/rpython/rclass.py Thu Jun 16 18:18:10 2005
@@ -365,7 +365,8 @@
raise TyperError("not an instance of %r: %r" % (
self.classdef.cls, value))
rinstance = getinstancerepr(self.rtyper, classdef)
- return rinstance.convert_const(value)
+ result = rinstance.convert_const(value)
+ return cast_pointer(self.lowleveltype, result)
# common case
try:
return self.prebuiltinstances[id(value)][1]
Modified: pypy/dist/pypy/rpython/rmodel.py
==============================================================================
--- pypy/dist/pypy/rpython/rmodel.py (original)
+++ pypy/dist/pypy/rpython/rmodel.py Thu Jun 16 18:18:10 2005
@@ -168,8 +168,10 @@
except (AssertionError, AttributeError):
realtype = '???'
if realtype != lltype:
- raise TyperError("inputconst(reqtype = %s, value = %s)" % (
- reqtype, value))
+ raise TyperError("inputconst(reqtype = %s, value = %s):\n"
+ "expected a %r,\n"
+ " got a %r" % (reqtype, value,
+ lltype, realtype))
c = Constant(value)
c.concretetype = lltype
return c
More information about the Pypy-commit
mailing list