We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5908a9e commit ee69434Copy full SHA for ee69434
sqlite3/strings.c
@@ -66,8 +66,8 @@ size_t strlen(const char *s) {
66
const v128_t *w = (void *)(s - align);
67
68
while (true) {
69
- const v128_t cmp = wasm_i8x16_eq(*w, (v128_t){});
70
- if (wasm_v128_any_true(cmp)) {
+ if (!wasm_i8x16_all_true(*w)) {
+ const v128_t cmp = wasm_i8x16_eq(*w, (v128_t){});
71
int mask = wasm_i8x16_bitmask(cmp) >> align << align;
72
return (char *)w - s + __builtin_ctz(mask);
73
}
@@ -158,6 +158,8 @@ char *strchr(const char *s, int c) {
158
<< ((b) % (8 * sizeof(size_t))))
159
160
size_t strspn(const char *s, const char *c) {
161
+ if (!c[0]) return 0;
162
+
163
const char *const a = s;
164
size_t byteset[32 / sizeof(size_t)] = {0};
165
0 commit comments