code_gen.c fix (BYTECODE_REDUCE_REF)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MOO |
New
|
Undecided
|
Unassigned |
Bug Description
https:/
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?