diff options
| author | gingerBill <bill@gingerbill.org> | 2024-12-02 11:23:55 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-12-02 11:23:55 +0000 |
| commit | e2ba8ff6e6fdbd23a10dcaf8b04f85960b8aa7c3 (patch) | |
| tree | 381714533720ae7f89e5345c5e997a1192acf377 /src/exact_value.cpp | |
| parent | d0f87913e2133b8101faef6ea76e0853d4da524b (diff) | |
Fix #4530
Diffstat (limited to 'src/exact_value.cpp')
| -rw-r--r-- | src/exact_value.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/exact_value.cpp b/src/exact_value.cpp index 5d6016ecc..ceaed84c1 100644 --- a/src/exact_value.cpp +++ b/src/exact_value.cpp @@ -370,7 +370,11 @@ gb_internal ExactValue exact_value_from_basic_literal(TokenKind kind, String con } case Token_Rune: { Rune r = GB_RUNE_INVALID; - utf8_decode(string.text, string.len, &r); + if (string.len == 1) { + r = cast(Rune)string.text[0]; + } else { + utf8_decode(string.text, string.len, &r); + } return exact_value_i64(r); } } |