Skip to content

Commit 6df72e4

Browse files
FractalFirLegNeato
authored andcommitted
Fixed 'is_i128', making it check if the type is an intiger, before casting it to check the intiger bit width
1 parent 936a86d commit 6df72e4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/rustc_codegen_nvvm/src/builder.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,11 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
13581358
// Helper function to check if a value is 128-bit integer
13591359
fn is_i128(&self, val: &'ll Value) -> bool {
13601360
let ty = self.val_ty(val);
1361-
unsafe { llvm::LLVMGetIntTypeWidth(ty) == 128 }
1361+
if unsafe { llvm::LLVMRustGetTypeKind(ty) == llvm::TypeKind::Integer } {
1362+
unsafe { llvm::LLVMGetIntTypeWidth(ty) == 128 }
1363+
} else {
1364+
false
1365+
}
13621366
}
13631367

13641368
// Helper to split i128 into low and high u64 parts

0 commit comments

Comments
 (0)