[racket-dev] [plt] Push #23267: master branch updated

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Tue Aug 16 13:02:28 EDT 2011

The C macro expanded into more than a single expression, but there was
no {} after the else, so the latter expressions always ran.

This is a great example :)

Jay

On Tue, Aug 16, 2011 at 11:00 AM, Jon Rafkind <rafkind at cs.utah.edu> wrote:
> What was the bug? :)
>
> On 08/16/2011 10:43 AM, mflatt at racket-lang.org wrote:
>> mflatt has updated `master' from d05f138ed2 to 311d55b5cf.
>>   http://git.racket-lang.org/plt/d05f138ed2..311d55b5cf
>>
>> =====[ 1 Commits ]======================================================
>>
>> Directory summary:
>>  100.0% src/racket/src/
>>
>> ~~~~~~~~~~
>>
>> 311d55b Matthew Flatt <mflatt at racket-lang.org> 2011-08-16 10:27
>> :
>> | fix bug that affects `free-identifier=?'
>> |
>> | This bug is in the "amazing that it lurked for years" category,
>> | as well as the "stupid use of C preprocessor" category.
>> :
>>   M src/racket/src/syntax.c |    5 +++--
>>
>> =====[ Overall Diff ]===================================================
>>
>> src/racket/src/syntax.c
>> ~~~~~~~~~~~~~~~~~~~~~~~
>> --- OLD/src/racket/src/syntax.c
>> +++ NEW/src/racket/src/syntax.c
>> @@ -365,7 +365,7 @@ XFORM_NONGCING static MZ_INLINE void DO_WRAP_POS_INC(Wrap_Pos *w)
>>  #define WRAP_POS_INIT_END(w) (w.l = scheme_null, w.a = NULL, w.is_limb = 0, w.pos = 0)
>>  #define WRAP_POS_END_P(w) SCHEME_NULLP(w.l)
>>  #define WRAP_POS_FIRST(w) w.a
>> -#define WRAP_POS_COPY(w, w2) w.l = (w2).l; w.a = (w2).a; w.is_limb= (w2).is_limb; w.pos = (w2).pos
>> +#define WRAP_POS_COPY(w, w2) w.l = (w2).l; w.a = (w2).a; w.is_limb = (w2).is_limb; w.pos = (w2).pos
>>
>>  /* Walking backwards through one chunk: */
>>
>> @@ -3618,8 +3618,9 @@ static Scheme_Object *resolve_env(WRAP_POS *_wraps,
>>    if (_wraps) {
>>      WRAP_POS_COPY(wraps, *_wraps);
>>      WRAP_POS_INC(wraps);
>> -  } else
>> +  } else {
>>      WRAP_POS_INIT(wraps, ((Scheme_Stx *)a)->wraps);
>> +  }
>>
>>    while (1) {
>>      if (WRAP_POS_END_P(wraps)) {
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93



Posted on the dev mailing list.