Fix ordered string comparisons. Unsigned arithmetic is evil.

This commit is contained in:
Mike Pall 2010-01-21 15:29:23 +01:00
parent d62dcd4a72
commit 419cbb3aa9

View File

@ -37,7 +37,7 @@ int32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b)
va >>= 32+(i<<3); vb >>= 32+(i<<3);
if (va == vb) break;
}
return (int32_t)(va - vb);
return va < vb ? -1 : 1;
}
}
return (int32_t)(a->len - b->len);