summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibRegex/RegexMatch.h
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibRegex/RegexMatch.h')
-rw-r--r--Userland/Libraries/LibRegex/RegexMatch.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibRegex/RegexMatch.h b/Userland/Libraries/LibRegex/RegexMatch.h
index 73b332ac3e..f5ddf929f7 100644
--- a/Userland/Libraries/LibRegex/RegexMatch.h
+++ b/Userland/Libraries/LibRegex/RegexMatch.h
@@ -136,7 +136,9 @@ public:
u32 operator[](size_t index) const
{
if (is_u8_view()) {
- return u8view()[index];
+ i8 ch = u8view()[index];
+ u8 value = *reinterpret_cast<u8*>(&ch);
+ return static_cast<u32>(value);
}
return u32view().code_points()[index];
}