Skip to content

Commit 430ab4e

Browse files
committed
Allow function pointers in CValue::const_val
Fixes rust-lang/rustc_codegen_cranelift#1430
1 parent a5fcfad commit 430ab4e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/value_and_place.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,13 @@ impl<'tcx> CValue<'tcx> {
329329
let msb = fx.bcx.ins().iconst(types::I64, (const_val >> 64) as u64 as i64);
330330
fx.bcx.ins().iconcat(lsb, msb)
331331
}
332-
ty::Bool | ty::Char | ty::Uint(_) | ty::Int(_) | ty::Ref(..) | ty::RawPtr(..) => {
332+
ty::Bool
333+
| ty::Char
334+
| ty::Uint(_)
335+
| ty::Int(_)
336+
| ty::Ref(..)
337+
| ty::RawPtr(..)
338+
| ty::FnPtr(..) => {
333339
let raw_val = const_val.size().truncate(const_val.to_bits(layout.size).unwrap());
334340
fx.bcx.ins().iconst(clif_ty, raw_val as i64)
335341
}

0 commit comments

Comments
 (0)