More robust implementation for finding the beginning of the stack.

This patch inserts an extra stack frame above the function that
calls the actual Nimrod code and ensures that a reference to this
frame is stored as the stack bottom.
This commit is contained in:
Reimer Behrends 2014-07-23 03:20:50 +02:00
commit 15734009ca
2 changed files with 23 additions and 8 deletions

View file

@ -2115,6 +2115,12 @@ when not defined(JS): #and not defined(NimrodVM):
locals = addr(locals)
setStackBottom(locals)
proc initStackBottomWith(locals: pointer) {.inline, compilerproc.} =
# We need to keep initStackBottom around for now to avoid
# bootstrapping problems.
when defined(setStackBottom):
setStackBottom(locals)
var
strDesc: TNimType