[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] PATCH -- FIX for bug #1280
From: |
Alexander . Shendi |
Subject: |
[Chicken-hackers] PATCH -- FIX for bug #1280 |
Date: |
Fri, 22 Apr 2016 23:03:57 +0200 |
User-agent: |
Mutt/ () |
Hello,
During testing CHICKEN 4.11.0rc1 on Android/ARM64 (a.k.a. aarch64) I have
encountered bug #1280.
Negative integer literals were not decoded correctly. The cause for this turned
out to
be a missing cast to signed int (on ARM platform the default char tye is
unsigned).
The following one line patch to runtime.c fixes the problem.
----------------------------------------------------------------------------------------------------------
--- chicken-4.11.0rc1/runtime.c
+++ chicken-4.11.0rc1.patched/runtime.c
@@ -9236,7 +9236,7 @@
return (C_word)(*(*str - 1));
case C_FIXNUM_BIT:
- val = (C_uword)*((*str)++) << 24; /* always big endian */
+ val = (C_uword)(signed char)*((*str)++) << 24; /* always big endian */
val |= ((C_uword)*((*str)++) & 0xff) << 16;
val |= ((C_uword)*((*str)++) & 0xff) << 8;
val |= ((C_uword)*((*str)++) & 0xff);
----------------------------------------------------------------------------------------------------------
Many thanks to Peter Bex for proposing this fix.
Best Regards,
/Alexander
FIX-1280.patch
Description: Text document
- [Chicken-hackers] PATCH -- FIX for bug #1280,
Alexander . Shendi <=