diff options
author | Reimer Behrends <behrends@gmail.com> | 2014-07-23 03:20:50 +0200 |
---|---|---|
committer | Reimer Behrends <behrends@gmail.com> | 2014-07-23 03:20:50 +0200 |
commit | 15734009ca9077cfc8c4139b8258b2db2d7492dd (patch) | |
tree | bf57ccd859e64dfd2bd86709585f903e33771a09 /lib | |
parent | dcf1425eb996db5d39a23c0360573f1addd4a850 (diff) | |
download | Nim-15734009ca9077cfc8c4139b8258b2db2d7492dd.tar.gz |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system.nim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim index 753205777..361e94462 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -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 |