aboutsummaryrefslogtreecommitdiff
path: root/src/unicode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unicode.cpp')
-rw-r--r--src/unicode.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/unicode.cpp b/src/unicode.cpp
index 665d5b182..ef95cde71 100644
--- a/src/unicode.cpp
+++ b/src/unicode.cpp
@@ -109,7 +109,7 @@ gb_internal isize utf8_decode(u8 const *str, isize str_len, Rune *codepoint_out)
u8 b1, b2, b3;
Utf8AcceptRange accept;
if (x >= 0xf0) {
- Rune mask = (cast(Rune)x << 31) >> 31;
+ Rune mask = -cast(Rune)(x & 1);
codepoint = (cast(Rune)s0 & (~mask)) | (GB_RUNE_INVALID & mask);
width = 1;
goto end;