Skip to content

Commit

Permalink
cxxrtl: fix formatting of UNICHAR
Browse files Browse the repository at this point in the history
This caused compilation to fail when the argument of any, not just
UNICHAR formatting operations, is bigger than 32 bits.

Fixes #4644
  • Loading branch information
rroohhh authored and whitequark committed Oct 9, 2024
1 parent 038e262 commit a761999
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backends/cxxrtl/runtime/cxxrtl/cxxrtl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ struct fmt_part {
}

case UNICHAR: {
uint32_t codepoint = val.template get<uint32_t>();
uint32_t codepoint = val.template zcast<32>().template get<uint32_t>();
if (codepoint >= 0x10000)
buf += (char)(0xf0 | (codepoint >> 18));
else if (codepoint >= 0x800)
Expand Down

0 comments on commit a761999

Please sign in to comment.