From e1b8e0a92e7c22dea25cd77376c49ab6486a8754 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Tue, 11 Mar 1997 04:47:33 +0100
Subject: [PATCH] fp->num_args wasn't initialized when calling C-functions.

Rev: src/interpret.c:1.32
---
 src/interpret.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/interpret.c b/src/interpret.c
index dd2f2b027f..08f5cbe0e2 100644
--- a/src/interpret.c
+++ b/src/interpret.c
@@ -4,7 +4,7 @@
 ||| See the files COPYING and DISCLAIMER for more information.
 \*/
 #include "global.h"
-RCSID("$Id: interpret.c,v 1.31 1997/03/11 03:36:39 hubbe Exp $");
+RCSID("$Id: interpret.c,v 1.32 1997/03/11 03:47:33 grubba Exp $");
 #include "interpret.h"
 #include "object.h"
 #include "program.h"
@@ -1318,6 +1318,8 @@ void apply_low(struct object *o, int fun, int args)
 #ifdef DEBUG
     if(d_flag) check_threads_etc();
 #endif
+    new_frame.num_args=args;
+    new_frame.num_locals=0;
     (*function->func.c_fun)(args);
   }else{
     int num_args;
@@ -1355,8 +1357,8 @@ void apply_low(struct object *o, int fun, int args)
     if(num_locals < num_args)
       fatal("Wrong number of arguments or locals in function def.\n");
 #endif
-    fp->num_locals=num_locals;
-    fp->num_args=num_args;
+    new_frame.num_locals=num_locals;
+    new_frame.num_args=num_args;
     eval_instruction(pc);
 #ifdef DEBUG
     if(sp<evaluator_stack)
-- 
GitLab