code gen bugfixes; marshal.nim implemented

This commit is contained in:
Araq 2011-06-26 17:21:52 +02:00
commit 990dc2d715
21 changed files with 725 additions and 422 deletions

View file

@ -253,7 +253,8 @@ proc rdLoc(a: TLoc): PRope =
proc addrLoc(a: TLoc): PRope =
result = a.r
if lfIndirect notin a.flags: result = con("&", result)
if lfIndirect notin a.flags and mapType(a.t) != ctArray:
result = con("&", result)
proc rdCharLoc(a: TLoc): PRope =
# read a location that may need a char-cast:
@ -333,7 +334,7 @@ proc initVariable(p: BProc, v: PSym) =
zeroVar(p, v.loc, b)
proc initTemp(p: BProc, tmp: var TLoc) =
if containsGarbageCollectedRef(tmp.t):
if containsGarbageCollectedRef(tmp.t) or isInvalidReturnType(tmp.t):
zeroTemp(p, tmp)
proc getTemp(p: BProc, t: PType, result: var TLoc) =