diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2023-05-01 08:23:38 -0700 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2023-05-01 08:23:38 -0700 |
| commit | 1c5678f77a61cf84f458376cccbd86a6d6942457 (patch) | |
| tree | 050cb6209cc15dc30940a459d8bad40f249d9e36 /lib/csc | |
| parent | Rewrite most of the compiler. (diff) | |
| download | chromatopelma-1c5678f77a61cf84f458376cccbd86a6d6942457.tar.zst | |
Fix an encoding issue for negative numbers.
Diffstat (limited to 'lib/csc')
| -rw-r--r-- | lib/csc/encoding.scheme | 4 |
1 files changed, 2 insertions, 2 deletions
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)))) |
