nac3core: fix bool to int conversion #130

Merged
sb10q merged 1 commits from bool_to_int_fix into master 2021-12-13 10:40:34 +08:00
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(),
) )