1.0.11.20: fix with-pinned-objects stack corruption potential
authorNikodemus Siivola <nikodemus@random-state.net>
Fri, 9 Nov 2007 17:38:14 +0000 (17:38 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 9 Nov 2007 17:38:14 +0000 (17:38 +0000)
commitd01a6883a21ee073c1a00c401c12185dbd2a8133
treed66055b907a60f74b1c8e85130577e9db0185d8c
parent51eadabe8132dcb908d3db4c057598bf56bcb851
1.0.11.20: fix with-pinned-objects stack corruption potential

* In the old WITH-PINNED-OBJECTS implementation we pushed pointers
  onto stack explicitly (without telling the compiler), executed
  the body, and _prior_to_returning_values_of_body_ popped the pointers.
  If the values from the body were in progress of being returned via
  unknown-values convention we would (try to) pop the pointers while
  the last callee stack frame (where the values to be returned are)
  is still on the stack. In many cases this was harmless, as the correct
  SP was restored soon enough, but there were bad interactions as well.

* Solution: instead of explicitly pushing pointers, use a LET to
  add binding to the current stack frame for the objects, and further
  use a magic TOUCH-OBJECT function implemented with an empty VOP
  to trick the compiler into keeping the variables live till the end
  of the body.

Probably not perfect, but seems to do the job. Of the added test-case,
the MULTIPLE variants used to fail prior to this.
NEWS
src/compiler/fndb.lisp
src/compiler/x86-64/c-call.lisp
src/compiler/x86-64/macros.lisp
src/compiler/x86/c-call.lisp
src/compiler/x86/macros.lisp
tests/compiler.impure.lisp
version.lisp-expr