[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: #1847: integer overflow when running 6.0.0pre1 tests (2)
From: |
Chicken Trac |
Subject: |
Re: #1847: integer overflow when running 6.0.0pre1 tests (2) |
Date: |
Wed, 18 Dec 2024 12:53:39 -0000 |
#1847: integer overflow when running 6.0.0pre1 tests (2)
--------------------------------+---------------------
Reporter: zerica | Owner: (none)
Type: defect | Status: new
Priority: major | Milestone: someday
Component: unknown | Version: 6.0.0
Resolution: | Keywords:
Estimated difficulty: medium |
--------------------------------+---------------------
Comment (by zerica):
hm, no, i mightve been wrong here. this was logged before:
{{{
chicken.h:2622:17: runtime error: implicit conversion from type 'unsigned
long' of value 9223372036854775808 (64-bit, unsigned) to type 'int64_t'
(aka 'long') changed the value to -9223372036854775808 (64-bit, signed)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior chicken.h:2622:17
}}}
which points to `C_s64 num = C_bignum_digits(x)[0];` in
{{{
inline static C_s64 C_num_to_int64(C_word x)
{
if(x & C_FIXNUM_BIT) {
return (C_s64)C_unfix(x);
} else {
C_s64 num = C_bignum_digits(x)[0];
#ifndef C_SIXTY_FOUR
if (C_bignum_size(x) > 1) num |=
(C_s64)(((C_u64)C_bignum_digits(x)[1]) << 32);
#endif
if (C_bignum_negativep(x)) return -num;
else return num;
}
}
}}}
--
Ticket URL: <https://bugs.call-cc.org/ticket/1847#comment:2>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.