tcnstseq works again
This commit is contained in:
parent
27ec76dd3a
commit
4cda0861f5
5 changed files with 11 additions and 3 deletions
|
|
@ -207,6 +207,8 @@ proc newCall(a, b: PSym): PNode =
|
|||
|
||||
proc addHiddenParam(routine: PSym, param: PSym) =
|
||||
var params = routine.ast.sons[paramsPos]
|
||||
# -1 is correct here as param.position is 0 based but we have at position 0
|
||||
# some nkEffect node:
|
||||
param.position = params.len-1
|
||||
addSon(params, newSymNode(param))
|
||||
incl(routine.typ.flags, tfCapturesEnv)
|
||||
|
|
|
|||
|
|
@ -187,6 +187,11 @@ proc semConstExpr(c: PContext, n: PNode): PNode =
|
|||
LocalError(e.info, errConstExprExpected)
|
||||
# error correction:
|
||||
result = e
|
||||
else:
|
||||
# recompute the types as 'eval' isn't guaranteed to construct types nor
|
||||
# that the types are sound:
|
||||
result = semExprWithType(c, result)
|
||||
result = fitNode(c, e.typ, result)
|
||||
|
||||
include hlo, seminst, semcall
|
||||
|
||||
|
|
|
|||
|
|
@ -421,7 +421,9 @@ proc semConst(c: PContext, n: PNode): PNode =
|
|||
def = fitRemoveHiddenConv(c, typ, def)
|
||||
else:
|
||||
typ = def.typ
|
||||
if typ == nil: continue
|
||||
if typ == nil:
|
||||
LocalError(a.sons[2].info, errConstExprExpected)
|
||||
continue
|
||||
if not typeAllowed(typ, skConst):
|
||||
LocalError(a.info, errXisNoType, typeToString(typ))
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -959,7 +959,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode =
|
|||
|
||||
proc fixType(result, n: PNode) {.inline.} =
|
||||
# XXX do it deeply for complex values
|
||||
if result.typ.isNil: result.typ = n.typ
|
||||
#if result.typ.isNil: result.typ = n.typ
|
||||
|
||||
proc execute(c: PCtx, start: int): PNode =
|
||||
var tos = PStackFrame(prc: nil, comesFrom: 0, next: nil)
|
||||
|
|
|
|||
1
todo.txt
1
todo.txt
|
|
@ -2,7 +2,6 @@ version 0.9.4
|
|||
=============
|
||||
|
||||
- new VM:
|
||||
- tcntseq fails
|
||||
- implement overflow checking
|
||||
- implement the FFI
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue