From 1c5678f77a61cf84f458376cccbd86a6d6942457 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Mon, 1 May 2023 08:23:38 -0700 Subject: Fix an encoding issue for negative numbers. --- guile-compat/lib/csc | 2 +- lib/csc/encoding.scheme | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/guile-compat/lib/csc b/guile-compat/lib/csc index c25bddb..c8a0323 120000 --- a/guile-compat/lib/csc +++ b/guile-compat/lib/csc @@ -1 +1 @@ -../.. \ No newline at end of file +../../lib/csc \ No newline at end of file diff --git a/lib/csc/encoding.scheme b/lib/csc/encoding.scheme index dfe6fb7..04f4dee 100644 --- a/lib/csc/encoding.scheme +++ b/lib/csc/encoding.scheme @@ -1,5 +1,5 @@ (define-library (csc encoding) - (export encode translate-labels) + (export encode int->le-bytes) (import (scheme base) (prefix (csc list) list.) (prefix (csc map) map.)) @@ -96,7 +96,7 @@ (< n #x-4000000000000000)) (error "int constant too large" n)) (when (negative? n) - (set! n (- #x10000000000000000 n))) + (set! n (+ #x10000000000000000 n))) (64->le-bytes w (+ 1 (* 2 n)))) -- cgit v1.3.1