Skip to content

Fixed 'is_i128', making it check if the type is an intiger, before casting it to check the intiger bit width#270

Merged
LegNeato merged 2 commits intoRust-GPU:mainfrom
FractalFir:i128_fix
Sep 19, 2025
Merged

Fixed 'is_i128', making it check if the type is an intiger, before casting it to check the intiger bit width#270
LegNeato merged 2 commits intoRust-GPU:mainfrom
FractalFir:i128_fix

Conversation

@FractalFir
Copy link
Copy Markdown
Collaborator

Small correctness fix: using 'is_i128' on non-int types is not correct, and will trigger LLVM assertions in debug mode.

This PR makes us check if the type is an int first.

Copy link
Copy Markdown
Contributor

@LegNeato LegNeato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can't believe I missed that. We should probably fix

fn int_width(&self, ty: &'ll Type) -> u64 {
too? float_width seems to behave correctly.

@LegNeato LegNeato merged commit 1d94a20 into Rust-GPU:main Sep 19, 2025
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants