fixes serious codegen regression that caused Nimble to misbehave
This commit is contained in:
parent
94e1488c24
commit
34143ee122
2 changed files with 48 additions and 1 deletions
|
|
@ -63,7 +63,7 @@ proc genTraverseProc(c: var TTraversalClosure, accessor: Rope, typ: PType) =
|
||||||
|
|
||||||
var p = c.p
|
var p = c.p
|
||||||
case typ.kind
|
case typ.kind
|
||||||
of tyGenericInst, tyGenericBody, tyTypeDesc, tyAlias:
|
of tyGenericInst, tyGenericBody, tyTypeDesc, tyAlias, tyDistinct:
|
||||||
genTraverseProc(c, accessor, lastSon(typ))
|
genTraverseProc(c, accessor, lastSon(typ))
|
||||||
of tyArray:
|
of tyArray:
|
||||||
let arraySize = lengthOrd(typ.sons[0])
|
let arraySize = lengthOrd(typ.sons[0])
|
||||||
|
|
|
||||||
47
tests/ccgbugs/tmarkerproc_regression.nim
Normal file
47
tests/ccgbugs/tmarkerproc_regression.nim
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
discard """
|
||||||
|
output: "done"
|
||||||
|
"""
|
||||||
|
|
||||||
|
type
|
||||||
|
Version* = distinct string
|
||||||
|
Special* = distinct string
|
||||||
|
|
||||||
|
VersionRangeEnum* = enum
|
||||||
|
verLater, # > V
|
||||||
|
verEarlier, # < V
|
||||||
|
verEqLater, # >= V -- Equal or later
|
||||||
|
verEqEarlier, # <= V -- Equal or earlier
|
||||||
|
verIntersect, # > V & < V
|
||||||
|
verEq, # V
|
||||||
|
verAny, # *
|
||||||
|
verSpecial # #head
|
||||||
|
|
||||||
|
VersionRange* = ref VersionRangeObj
|
||||||
|
VersionRangeObj = object
|
||||||
|
case kind*: VersionRangeEnum
|
||||||
|
of verLater, verEarlier, verEqLater, verEqEarlier, verEq:
|
||||||
|
ver*: Version
|
||||||
|
of verSpecial:
|
||||||
|
spe*: Special
|
||||||
|
of verIntersect:
|
||||||
|
verILeft, verIRight: VersionRange
|
||||||
|
of verAny:
|
||||||
|
nil
|
||||||
|
|
||||||
|
proc foo(x: string): VersionRange =
|
||||||
|
new(result)
|
||||||
|
result.kind = verEq
|
||||||
|
result.ver = Version(x)
|
||||||
|
|
||||||
|
proc main =
|
||||||
|
var a: array[5000, VersionRange]
|
||||||
|
for i in 0 ..< 5000:
|
||||||
|
a[i] = foo($i & "some longer text here " & $i)
|
||||||
|
GC_fullcollect()
|
||||||
|
for i in 0 ..< 5000:
|
||||||
|
let expected = $i & "some longer text here " & $i
|
||||||
|
if a[i].ver.string != expected:
|
||||||
|
quit "bug!"
|
||||||
|
echo "done"
|
||||||
|
|
||||||
|
main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue