aboutsummaryrefslogtreecommitdiff
path: root/src/lj_str.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lj_str.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lj_str.c b/src/lj_str.c
index ec74afa5..0253c15e 100644
--- a/src/lj_str.c
+++ b/src/lj_str.c
@@ -41,8 +41,9 @@ int32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b)
41static LJ_AINLINE int str_fastcmp(const char *a, const char *b, MSize len) 41static LJ_AINLINE int str_fastcmp(const char *a, const char *b, MSize len)
42{ 42{
43 MSize i = 0; 43 MSize i = 0;
44 lua_assert(len > 0); 44 lj_assertX(len > 0, "fast string compare with zero length");
45 lua_assert((((uintptr_t)a+len-1) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4); 45 lj_assertX((((uintptr_t)a+len-1) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4,
46 "fast string compare crossing page boundary");
46 do { /* Note: innocuous access up to end of string + 3. */ 47 do { /* Note: innocuous access up to end of string + 3. */
47 uint32_t v = lj_getu32(a+i) ^ *(const uint32_t *)(b+i); 48 uint32_t v = lj_getu32(a+i) ^ *(const uint32_t *)(b+i);
48 if (v) { 49 if (v) {