From 70a0f07ec41504f2d26263d7d682d57645f6cef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Wed, 25 Aug 2004 14:15:29 +0200 Subject: [PATCH] Bugfix. Rev: src/operators.c:1.194 --- src/operators.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/operators.c b/src/operators.c index 131a29021f..b59f198f22 100644 --- a/src/operators.c +++ b/src/operators.c @@ -2,12 +2,12 @@ || 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: operators.c,v 1.193 2004/08/24 14:34:06 grubba Exp $ +|| $Id: operators.c,v 1.194 2004/08/25 12:15:29 grubba Exp $ */ #include "global.h" #include <math.h> -RCSID("$Id: operators.c,v 1.193 2004/08/24 14:34:06 grubba Exp $"); +RCSID("$Id: operators.c,v 1.194 2004/08/25 12:15:29 grubba Exp $"); #include "interpret.h" #include "svalue.h" #include "multiset.h" @@ -1553,7 +1553,8 @@ static int generate_sum(node *n) { emit0(F_ADD_FLOATS); } - else if(pike_types_le(first_arg[0]->type, int_type_string) && + else if(first_arg[0]->type && second_arg[0]->type && + pike_types_le(first_arg[0]->type, int_type_string) && pike_types_le(second_arg[0]->type, int_type_string)) { emit0(F_ADD_INTS); @@ -1581,13 +1582,15 @@ static int generate_sum(node *n) return 1; } } - else if(pike_types_le(first_arg[0]->type, int_type_string) && + else if(first_arg[0]->type && second_arg[0]->type && + pike_types_le(first_arg[0]->type, int_type_string) && pike_types_le(second_arg[0]->type, int_type_string)) { do_docode(*first_arg, 0); do_docode(*second_arg, 0); emit0(F_ADD_INTS); - if (pike_types_le(third_arg[0]->type, int_type_string)) { + if (third_arg[0]->type && + pike_types_le(third_arg[0]->type, int_type_string)) { do_docode(*third_arg, 0); emit0(F_ADD_INTS); return 1; -- GitLab