- /* If the function did not end with an return statement, create exit code */
- if (!isbrk) {
-#if 0
- /* If the function has a return type, flag an error */
- if (!voidfunc) {
- Error ("Function `%s' must return a value", Func->Name);
+ /* Need a starting curly brace */
+ ConsumeLCurly ();
+
+ /* Parse local variable declarations if any */
+ DeclareLocals ();
+
+ /* Remember the current stack pointer. All variables allocated elsewhere
+ * must be dropped when doing a return from an inner block.
+ */
+ CurrentFunc->TopLevelSP = oursp;
+
+ /* Now process statements in this block */
+ HadReturn = 0;
+ while (CurTok.Tok != TOK_RCURLY) {
+ if (CurTok.Tok != TOK_CEOF) {
+ HadReturn = Statement (0);
+ } else {
+ break;