Mercurial > projects > ldc
changeset 1510:b6b6afc2dfc7
Put scope-limited data on the stack instead of using 'new' and 'delete'.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sat, 20 Jun 2009 19:44:54 +0200 |
parents | e07f15c4ab4d |
children | 5b66008246bb |
files | gen/functions.cpp |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/functions.cpp Sat Jun 20 19:12:04 2009 +0200 +++ b/gen/functions.cpp Sat Jun 20 19:44:54 2009 +0200 @@ -774,10 +774,12 @@ } // output function body - irfunction->gen = new FuncGen; - fd->fbody->toIR(gIR); - delete irfunction->gen; - irfunction->gen = 0; + { + FuncGen fg; + irfunction->gen = &fg; + fd->fbody->toIR(gIR); + irfunction->gen = 0; + } // TODO: clean up this mess