From 4bd49f7294a5dd3904e442c9b546612b39a74394 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm <mast@lysator.liu.se> Date: Thu, 24 Jan 2008 18:48:18 +0100 Subject: [PATCH] Fixed a couple of places where integer svalues without a defined subtype were put on the stack. (These svalues can cause zero_type() calls to behave randomly.) Rev: src/operators.c:1.225 --- src/operators.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/operators.c b/src/operators.c index 07a1801444..5578c9bcf9 100644 --- a/src/operators.c +++ b/src/operators.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: operators.c,v 1.224 2008/01/09 13:42:49 grubba Exp $ +|| $Id: operators.c,v 1.225 2008/01/24 17:48:18 mast Exp $ */ #include "global.h" @@ -280,6 +280,7 @@ PMOD_EXPORT void o_cast_to_int(void) #endif /* AUTO_BIGNUM */ { sp[-1].type=T_INT; + sp[-1].subtype = NUMBER_NUMBER; sp[-1].u.integer=i; } } @@ -300,6 +301,7 @@ PMOD_EXPORT void o_cast_to_int(void) int i=atoi(sp[-1].u.string->str); free_string(sp[-1].u.string); sp[-1].type=T_INT; + sp[-1].subtype = NUMBER_NUMBER; sp[-1].u.integer=i; } else @@ -314,6 +316,7 @@ PMOD_EXPORT void o_cast_to_int(void) int i=STRTOL(sp[-1].u.string->str,0,10); free_string(sp[-1].u.string); sp[-1].type=T_INT; + sp[-1].subtype = NUMBER_NUMBER; sp[-1].u.integer=i; } #endif /* AUTO_BIGNUM */ @@ -4189,6 +4192,7 @@ PMOD_EXPORT void o_not(void) default: free_svalue(sp-1); sp[-1].type=T_INT; + sp[-1].subtype = NUMBER_NUMBER; sp[-1].u.integer=0; } } -- GitLab