forked from M-Labs/nac3
1
0
Fork 0

nac3core: fix bool to int conversion

This commit is contained in:
ychenfo 2021-12-13 04:11:31 +08:00
parent 4d2fd9582a
commit 82359b81a2
1 changed files with 4 additions and 4 deletions

View File

@ -69,10 +69,10 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
if ctx.unifier.unioned(arg_ty, boolean) { if ctx.unifier.unioned(arg_ty, boolean) {
Some( Some(
ctx.builder ctx.builder
.build_int_s_extend( .build_int_z_extend(
arg.into_int_value(), arg.into_int_value(),
ctx.ctx.i32_type(), ctx.ctx.i32_type(),
"sext", "zext",
) )
.into(), .into(),
) )
@ -129,10 +129,10 @@ pub fn get_builtins(primitives: &mut (PrimitiveStore, Unifier)) -> BuiltinInfo {
{ {
Some( Some(
ctx.builder ctx.builder
.build_int_s_extend( .build_int_z_extend(
arg.into_int_value(), arg.into_int_value(),
ctx.ctx.i64_type(), ctx.ctx.i64_type(),
"sext", "zext",
) )
.into(), .into(),
) )