From 40aea807d777b11c0c1103220dd8ff36735ce5d3 Mon Sep 17 00:00:00 2001
From: Martin Stjernholm <mast@lysator.liu.se>
Date: Wed, 22 Apr 2009 00:47:43 +0200
Subject: [PATCH] Don't index UNDEFINED as bignum.

---
 .gitattributes  | 1 -
 src/operators.c | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/.gitattributes b/.gitattributes
index 0016ee0e9c..884509883f 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -767,7 +767,6 @@ testfont binary
 /src/object.h foreign_ident
 /src/opcodes.c foreign_ident
 /src/opcodes.h foreign_ident
-/src/operators.c foreign_ident
 /src/operators.h foreign_ident
 /src/patch_cc1.c foreign_ident
 /src/peep.c foreign_ident
diff --git a/src/operators.c b/src/operators.c
index d6e2be45fe..9c4cc19d82 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.258 2010/05/27 23:16:59 mast Exp $
+|| $Id$
 */
 
 #include "global.h"
@@ -124,7 +124,7 @@ void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)
 
 #ifdef AUTO_BIGNUM
   case T_INT:
-    if (ind->type == T_STRING) {
+    if (ind->type == T_STRING && !IS_UNDEFINED (what)) {
       INT_TYPE val = what->u.integer;
 
       convert_svalue_to_bignum(what);
-- 
GitLab