From 167da2f1b88a1ad1e4b08aa72a8f7d5721cb1c37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Wed, 18 Jun 2008 23:23:12 +0200
Subject: [PATCH] low_make_callable() now uses the new function call checker
 (check_splice_call()/new_get_return_type()) rather than the old
 (check_call()) in the debug code.

Rev: src/constants.c:1.61
---
 src/constants.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/constants.c b/src/constants.c
index 13d0a3098e..7ab8f954b7 100644
--- a/src/constants.c
+++ b/src/constants.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: constants.c,v 1.60 2008/05/11 14:55:53 mast Exp $
+|| $Id: constants.c,v 1.61 2008/06/18 21:23:12 grubba Exp $
 */
 
 #include "global.h"
@@ -93,11 +93,11 @@ int global_callable_flags=0;
 
 /* Eats one ref to 'type' and 'name' */
 PMOD_EXPORT struct callable *low_make_callable(c_fun fun,
-				   struct pike_string *name,
-				   struct pike_type *type,
-				   int flags,
-				   optimize_fun optimize,
-				   docode_fun docode)
+					       struct pike_string *name,
+					       struct pike_type *type,
+					       int flags,
+					       optimize_fun optimize,
+					       docode_fun docode)
 {
   struct callable *f=alloc_callable();
   INIT_PIKE_MEMOBJ(f);
@@ -111,7 +111,14 @@ PMOD_EXPORT struct callable *low_make_callable(c_fun fun,
   f->internal_flags = global_callable_flags;
 #ifdef PIKE_DEBUG
   {
-    struct pike_type *z = check_call(function_type_string, type, 0);
+    struct pike_type *z = NULL;
+    add_ref(type);
+    type = check_splice_call(name, type, 1, mixed_type_string, NULL,
+			     CALL_INHIBIT_WARNINGS);
+    if (type) {
+      z = new_get_return_type(type, CALL_INHIBIT_WARNINGS);
+      free_type(type);
+    }
     f->may_return_void = (z == void_type_string);
     if(!z) Pike_fatal("Function has no valid return type.\n");
     free_type(z);
-- 
GitLab