diff --git a/compiler/compiler.go b/compiler/compiler.go index d91de7ff..5c4ad483 100644 --- a/compiler/compiler.go +++ b/compiler/compiler.go @@ -2559,7 +2559,7 @@ func (c *Compiler) parseConvert(typeFrom, typeTo types.Type, value llvm.Value, p // Conversion between two integers. if sizeFrom > sizeTo { return c.builder.CreateTrunc(value, llvmTypeTo, ""), nil - } else if typeTo.Info()&types.IsUnsigned != 0 { // if unsigned + } else if typeFrom.Info()&types.IsUnsigned != 0 { // if unsigned return c.builder.CreateZExt(value, llvmTypeTo, ""), nil } else { // if signed return c.builder.CreateSExt(value, llvmTypeTo, ""), nil diff --git a/src/runtime/print.go b/src/runtime/print.go index e0d6fc43..dd9f1dcb 100644 --- a/src/runtime/print.go +++ b/src/runtime/print.go @@ -39,7 +39,7 @@ func printuint16(n uint16) { printuint32(uint32(n)) } -func printint16(n uint16) { +func printint16(n int16) { printint32(int32(n)) }