Fix stack underflow exception when computing the value of an empty

block.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@36422 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2013-03-24 17:29:43 +00:00
parent 1fc2e5fb63
commit b7a0150e02
2 changed files with 14 additions and 0 deletions

View file

@ -4,6 +4,9 @@
return the receiver from a method without an explicit return
statement.
* STCompiler.m (-compileStatements:blockFlag:): Return nil from an
empty block and the receiver from an empty method.
2013-03-24 Wolfgang Lux <wolfgang.lux@gmail.com>
* STExecutionContext.h: Change type of instruction pointer attribute

View file

@ -654,6 +654,17 @@ extern int STCparse(void *context);
}
[self compileExpression:expr];
}
else if (first)
{
if (blockFlag)
{
[self emitPushNil];
}
else
{
[self emitPushSelf];
}
}
if (blockFlag)
{