In FLO:VECTOR-LENGTH, coerce length to fixnum before OBJECT->FIXNUM.
authorTaylor R Campbell <campbell@mumble.net>
Sat, 28 Aug 2010 20:52:26 +0000 (20:52 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sat, 28 Aug 2010 20:52:26 +0000 (20:52 +0000)
The previous open-coding worked whenever OBJECT->FIXNUM merely
shifted left by the tag width, ignoring whatever tag was there
before.  The SVM does not do this, however.

src/compiler/rtlgen/opncod.scm

index 23964e9781f38b6956920984c01f134e00cd39ad..f6dba116cbb313d1998a839ced6ec13f0115530a 100644 (file)
@@ -617,14 +617,14 @@ USA.
              (rtl:make-fixnum->object
               (rtl:make-fixnum-2-args
                'FIXNUM-LSH
-               (rtl:make-object->fixnum (rtl:make-fetch locative))
+               (rtl:make-object->fixnum (rtl:vector-length-fetch locative))
                (rtl:make-object->fixnum (rtl:make-constant -1))
                false)))
            (lambda (locative)
              (rtl:make-fixnum->object
               (rtl:make-fixnum-2-args
                'FIXNUM-QUOTIENT
-               (rtl:make-object->fixnum (rtl:make-fetch locative))
+               (rtl:make-object->fixnum (rtl:vector-length-fetch locative))
                (rtl:make-object->fixnum (rtl:make-constant quantum))
                false)))))))