Browse Source

Set lvl & param_offset[lvl] & param_offset[lvl+1] before FIXUP call of resolved select function

Michal Matyska 19 years ago
parent
commit
6fcb46beae
1 changed files with 6 additions and 3 deletions
  1. 6 3
      select.c

+ 6 - 3
select.c

@@ -243,12 +243,10 @@ int resolve_select(select_t* s)
 				goto not_found;
 			}
 		}
-		if (t->table[table_idx].flags & FIXUP_CALL) {
-			if (t->table[table_idx].new_f(NULL, s, NULL)<0) goto not_found;
-		}
 
 		if (t->table[table_idx].flags & NESTED) {
 			if (nested < MAX_NESTED_CALLS-1) { /* need space for final function */
+				s->lvl = nested;
 				s->f[nested++] = f;
 				s->param_offset[nested] = param_idx+1;
 			} else {
@@ -258,6 +256,11 @@ int resolve_select(select_t* s)
 		} else {
 			param_idx++;
 		}
+
+		if (t->table[table_idx].flags & FIXUP_CALL) {
+			if (t->table[table_idx].new_f(NULL, s, NULL)<0) goto not_found;
+		}
+
 		f = t->table[table_idx].new_f;
 	}