mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 15:44:14 +00:00
fixes #4034
This commit is contained in:
@@ -570,6 +570,7 @@ proc getTypeDescAux(m: BModule, typ: PType, check: var IntSet): Rope =
|
||||
of tyRange, tyEnum:
|
||||
let t = if t.kind == tyRange: t.lastSon else: t
|
||||
result = getTypeName(t)
|
||||
if isImportedCppType(t): return
|
||||
idTablePut(m.typeCache, t, result)
|
||||
var size: int
|
||||
if firstOrd(t) < 0:
|
||||
|
||||
@@ -301,7 +301,8 @@ proc resetLoc(p: BProc, loc: var TLoc) =
|
||||
proc constructLoc(p: BProc, loc: TLoc, isTemp = false) =
|
||||
let typ = skipTypes(loc.t, abstractRange)
|
||||
if not isComplexValueType(typ):
|
||||
linefmt(p, cpsStmts, "$1 = 0;$n", rdLoc(loc))
|
||||
linefmt(p, cpsStmts, "$1 = ($2)0;$n", rdLoc(loc),
|
||||
getTypeDesc(p.module, typ))
|
||||
else:
|
||||
if not isTemp or containsGarbageCollectedRef(loc.t):
|
||||
# don't use memset for temporary values for performance if we can
|
||||
|
||||
Reference in New Issue
Block a user