Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check UInt16#to_u8 for overflow in the interpreter #14436

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/crystal/interpreter/primitives.cr
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ class Crystal::Repl::Compiler
in {.u16?, .i32?} then zero_extend(6, node: node)
in {.u16?, .i64?} then zero_extend(6, node: node)
in {.u16?, .i128?} then zero_extend(14, node: node)
in {.u16?, .u8?} then nop
in {.u16?, .u8?} then checked ? (zero_extend(6, node: node); u64_to_u8(node: node)) : nop
in {.u16?, .u16?} then nop
in {.u16?, .u32?} then zero_extend(6, node: node)
in {.u16?, .u64?} then zero_extend(6, node: node)
Expand Down
Loading