Author: Antonio Cuni <anto.c...@gmail.com> Branch: faster-rstruct-2 Changeset: r91361:65b6be2c1b4f Date: 2017-05-22 12:00 +0200 http://bitbucket.org/pypy/pypy/changeset/65b6be2c1b4f/
Log: enforce the annotation of write_float_at_mem: the problem fixed by 0e91701e92f0 was that we mixed a r_floatstorage with a float: on 32 bit they are different types but the annotator union()ed them to Float, causing nonsense at every place calling write_float_at_mem. The goal of this commit is to catch this kind of bug at translation time diff --git a/rpython/jit/backend/llsupport/llmodel.py b/rpython/jit/backend/llsupport/llmodel.py --- a/rpython/jit/backend/llsupport/llmodel.py +++ b/rpython/jit/backend/llsupport/llmodel.py @@ -5,7 +5,8 @@ from rpython.rtyper.annlowlevel import llhelper, MixLevelHelperAnnotator from rpython.rtyper.annlowlevel import hlstr, hlunicode from rpython.rtyper.llannotation import lltype_to_annotation -from rpython.rlib.objectmodel import we_are_translated, specialize, compute_hash +from rpython.rlib.objectmodel import (we_are_translated, specialize, compute_hash, + enforceargs) from rpython.jit.metainterp import history, compile from rpython.jit.metainterp.optimize import SpeculativeError from rpython.jit.codewriter import heaptracker, longlong @@ -494,6 +495,7 @@ return llop.raw_load(longlong.FLOATSTORAGE, gcref, ofs) @specialize.argtype(1) + @enforceargs(newvalue=longlong.r_float_storage) def write_float_at_mem(self, gcref, ofs, newvalue): llop.raw_store(lltype.Void, gcref, ofs, newvalue) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit