Skip to content

Commit

Permalink
fixes some issues (#343)
Browse files Browse the repository at this point in the history
* fixes some issues

* Update src/nimony/xints.nim

Co-authored-by: Andreas Rumpf <[email protected]>

---------

Co-authored-by: Andreas Rumpf <[email protected]>
  • Loading branch information
ringabout and Araq authored Jan 8, 2025
1 parent 2b38e7e commit 8805b15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/nifc/codegen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/nimony/xints.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 8805b15

Please sign in to comment.