[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] this code looks wrong to me
From: |
Jörg F . Wittenberger |
Subject: |
[Chicken-hackers] this code looks wrong to me |
Date: |
Wed, 17 Feb 2016 11:43:29 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux armv7l; rv:38.0) Gecko/20100101 Icedove/38.4.0 |
Hi,
I'm browsing runtime.c to assess how big a change modifications to the
argvector would be. My concept BTW: I'd first introduce a new macro
like C_allocate_argvector, which would expand in just to the C_alloc,
then change to compiler to use it. From this point we could play with
the macros to test what's worth persuading.
Brought me to read C_location_ref and that looks wrong:
case C_U32_LOCATIVE:
av2 = C_alloc(4);
av2[ 0 ] = C_SCHEME_UNDEFINED;
av2[ 1 ] = k;
av2[ 2 ] = (C_word)(ptr - 1);
av2[ 3 ] = C_fix(0);
C_peek_unsigned_integer(3, av);
case C_S32_LOCATIVE:
av2 = C_alloc(4);
av2[ 0 ] = C_SCHEME_UNDEFINED;
av2[ 1 ] = k;
av2[ 2 ] = (C_word)(ptr - 1);
av2[ 3 ] = C_fix(0);
C_peek_signed_integer(3, av);
IMHO we don't need to allocate a fresh argvector here. Do we?
But at least we should not allocate it, fill it and then forget about it
and use the old one as is - I guess.
Cheers
/Jörg
- [Chicken-hackers] this code looks wrong to me,
Jörg F . Wittenberger <=