MOO

code_gen.c fix (BYTECODE_REDUCE_REF)

Bug #354964 reported by Luke-Jr
2
Affects Status Importance Assigned to Milestone
MOO
New
Undecided
Unassigned

Bug Description

https://sourceforge.net/tracker/?func=detail&aid=573221&group_id=3692&atid=303692

In LambdaMOO version 1.8.1...

 In the file code_gen.c, with BYTECODE_REDUCE_REF
 turned on, you should get a warning (depending on
 your compiler environment) regarding an invalid
 pointer as the fourth arg for qsort on line 1208. I
 believe that this is the correct way to implement the
 qsort comparison function:

 Replace this function (line 1127):

 #ifdef BYTECODE_REDUCE_REF
 static int
 bbd_cmp(int *a, int *b)
 {
 return *a - *b;
 }
 #endif /* BYTECODE_REDUCE_REF */

 With this:

 #ifdef BYTECODE_REDUCE_REF
 static int
 bbd_cmp(const void *a, const void *b)
 {
 return *(int **)a - *(int **)b;
 }
 #endif /* BYTECODE_REDUCE_REF */

 Can anyone confirm this?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.