@@ -277,7 +277,9 @@ static void cFunction() {
}
static void cReturn() {
- if(returnIndex >= RETURN_BUFFER) {
+ if(varIndex == 0) {
+ cError("return without a function on line %d", line);
+ } else if(returnIndex >= RETURN_BUFFER) {
cError("too much returns in function around line %d", line);
cAddOperation(OP_POP);