From: Guillermo J. Rozas Date: Thu, 19 Jul 1990 19:11:32 +0000 (+0000) Subject: Take word size into account. Shifts past fixnum size always return X-Git-Tag: 20090517-FFI~11316 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=ae54c2f1ffa1606b1b757f40d5ff93f1afc06e01;p=mit-scheme.git Take word size into account. Shifts past fixnum size always return 0. --- diff --git a/v7/src/microcode/fixnum.c b/v7/src/microcode/fixnum.c index 9f43f5f6d..0a718316e 100644 --- a/v7/src/microcode/fixnum.c +++ b/v7/src/microcode/fixnum.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fixnum.c,v 9.31 1990/07/15 22:49:32 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fixnum.c,v 9.32 1990/07/19 19:11:32 jinx Rel $ Copyright (c) 1987, 1988, 1989, 1990 Massachusetts Institute of Technology @@ -313,11 +313,11 @@ DEFINE_PRIMITIVE ("FIXNUM-LSH", Prim_fixnum_lsh, 2, 2, 0) if (y < 0) { - z = (x >> (- y)); + z = ((y < (- FIXNUM_LENGTH)) ? 0 : (x >> (- y))); } else { - z = (x << y); + z = ((y > FIXNUM_LENGTH) ? 0 : (x << y)); } return (LONG_TO_FIXNUM (z)); }