From 75dbd90b1b727bb28cec17dcf492a02aa1e57045 Mon Sep 17 00:00:00 2001 From: Kent Dybvig Date: Tue, 26 Apr 2016 18:48:07 -0400 Subject: [PATCH] - converted s_test_schlib shifts of -1 to equivalent shifts of 1 to avoid undefined left-shift behavior on negative numbers. prim5.c original commit: 7427dda85c1ae43f1e3c8f8749a578d50764fdfd --- LOG | 3 +++ c/prim5.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/LOG b/LOG index 9b161f4afb..36b1851034 100644 --- a/LOG +++ b/LOG @@ -36,3 +36,6 @@ zlib and nanopass, since they are logically part of the git clone. It does run make distclean in zlib. makefiles/Makefile.in +- converted s_test_schlib shifts of -1 to equivalent shifts of 1 to + avoid undefined left-shift behavior on negative numbers. + prim5.c diff --git a/c/prim5.c b/c/prim5.c index c4d1031656..6793a18b7f 100644 --- a/c/prim5.c +++ b/c/prim5.c @@ -1686,8 +1686,8 @@ static void s_test_schlib() { INT test = 0; I32 n1 = 0x73215609; I64 n2 = n1 * 37; - I32 n3 = (I32)-1<<31; - I64 n4 = (I64)-1<<63; + I32 n3 = (I32)1<<31; + I64 n4 = (I64)1<<63; I32 n5 = -1; SCHLIBTEST(Sinteger_value(Sinteger(n1)) == n1)