From 8805b155b20bcde90cd1aedac3754f3f97805064 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Thu, 9 Jan 2025 03:34:38 +0800 Subject: [PATCH] fixes some issues (#343) * fixes some issues * Update src/nimony/xints.nim Co-authored-by: Andreas Rumpf --------- Co-authored-by: Andreas Rumpf --- src/nifc/codegen.nim | 2 -- src/nimony/xints.nim | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nifc/codegen.nim b/src/nifc/codegen.nim index d1ac09f5..688bc60d 100644 --- a/src/nifc/codegen.nim +++ b/src/nifc/codegen.nim @@ -374,9 +374,7 @@ proc genVarDecl(c: var GeneratedCode; t: Tree; n: NodePos; vk: VarKind; toExtern moveToInitSection: c.add name c.add AsgnOpr - inc c.inSimpleInit genx c, t, d.value - dec c.inSimpleInit c.add Semicolon else: c.add AsgnOpr diff --git a/src/nimony/xints.nim b/src/nimony/xints.nim index dc63346a..ce56f801 100644 --- a/src/nimony/xints.nim +++ b/src/nimony/xints.nim @@ -116,7 +116,9 @@ proc `$`*(a: xint): string = else: $a.val proc createXint*(x: int64): xint = - if x < 0: + if x == low(int64): + xint(neg: true, val: uint64(high(int64)) + 1'u64) + elif x < 0: xint(neg: true, val: uint64(-x)) else: xint(neg: false, val: uint64(x))