mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-03 02:18:00 +00:00
@@ -573,4 +573,4 @@ proc maskBytes*(arg: Int128, numbytes: int): Int128 {.noinit.} =
|
||||
of 8:
|
||||
return maskUInt64(arg)
|
||||
else:
|
||||
assert(false, "masking only implemented for 1, 2, 4 and 8 bytes")
|
||||
raiseAssert "masking only implemented for 1, 2, 4 and 8 bytes"
|
||||
|
||||
@@ -252,6 +252,7 @@ proc hasCommand(n: PNode): bool =
|
||||
of nkStmtList, nkStmtListExpr, nkWhenStmt, nkElifBranch, nkElse,
|
||||
nkStaticStmt, nkLetSection, nkConstSection, nkVarSection,
|
||||
nkIdentDefs:
|
||||
result = false
|
||||
for a in n:
|
||||
if a.hasCommand:
|
||||
return true
|
||||
|
||||
@@ -356,12 +356,13 @@ proc useVar(a: PEffects, n: PNode) =
|
||||
type
|
||||
TIntersection = seq[tuple[id, count: int]] # a simple count table
|
||||
|
||||
proc addToIntersection(inter: var TIntersection, s: int, zeroInit: bool) =
|
||||
proc addToIntersection(inter: var TIntersection, s: int, initOnly: bool) =
|
||||
for j in 0..<inter.len:
|
||||
if s == inter[j].id:
|
||||
inc inter[j].count
|
||||
if not initOnly:
|
||||
inc inter[j].count
|
||||
return
|
||||
if zeroInit:
|
||||
if initOnly:
|
||||
inter.add((id: s, count: 0))
|
||||
else:
|
||||
inter.add((id: s, count: 1))
|
||||
|
||||
@@ -1753,6 +1753,7 @@ proc isTupleRecursive(t: PType, cycleDetector: var IntSet): bool =
|
||||
return true
|
||||
case t.kind
|
||||
of tyTuple:
|
||||
result = false
|
||||
var cycleDetectorCopy: IntSet
|
||||
for i in 0..<t.len:
|
||||
cycleDetectorCopy = cycleDetector
|
||||
|
||||
Reference in New Issue
Block a user