develooper Front page | perl.perl6.internals | Postings from June 2002

[PATCH] perlarray strange behaviour

Thread Next
From:
Josef Höök
Date:
June 25, 2002 02:54
Subject:
[PATCH] perlarray strange behaviour
Message ID:
Pine.GSO.4.21.0206251130190.25808-200000@chicken.stacken.kth.se
--- perlarray.pmc.orig	Tue Jun 25 11:23:40 2002
+++ perlarray.pmc	Tue Jun 25 11:23:14 2002
@@ -100,7 +100,7 @@
             resize_array(interpreter, SELF, ix+1);
         }
         if (ix < 0) {
-            ix += SELF->cache.int_val;
+            ix = SELF->cache.int_val;
         }
 
         array = ((Buffer *) SELF->data)->bufstart;
@@ -128,7 +128,7 @@
             resize_array(interpreter, SELF, ix+1);
         }
         if (ix < 0) {
-            ix += SELF->cache.int_val;
+            ix = SELF->cache.int_val;
         }
 
         array = ((Buffer *) SELF->data)->bufstart;
@@ -156,7 +156,7 @@
             resize_array(interpreter, SELF, ix+1);
         }
         else if (ix < 0) {
-            ix += SELF->cache.int_val;
+            ix = SELF->cache.int_val;
         }
 
         array = ((Buffer *) SELF->data)->bufstart;
@@ -180,7 +180,7 @@
             resize_array(interpreter, SELF, ix+1);
         }
         else if (ix < 0) {
-            ix += SELF->cache.int_val;
+            ix = SELF->cache.int_val;
         }
 
         array = ((Buffer *) SELF->data)->bufstart;
@@ -236,10 +236,10 @@
 
         if (ix >= SELF->cache.int_val) {
             resize_array(interpreter, SELF, ix+1);
-        }
+	}
         else if (ix < 0) {
-            ix += SELF->cache.int_val;
-        }
+            ix = SELF->cache.int_val;
+	}
 
         array = ((Buffer *) SELF->data)->bufstart;
         element = array[ix];
@@ -284,7 +284,7 @@
             resize_array(interpreter, SELF, ix+1);
         }
         else if (ix < 0) {
-            ix += SELF->cache.int_val;
+            ix = SELF->cache.int_val;
         }
 
         array = ((Buffer *) SELF->data)->bufstart;
@@ -328,7 +328,7 @@
             resize_array(interpreter, SELF, ix+1);
         }
         else if (ix < 0) {
-            ix += SELF->cache.int_val;
+            ix = SELF->cache.int_val;
         }
 
         array = ((Buffer *) SELF->data)->bufstart;
@@ -356,7 +356,7 @@
             resize_array(interpreter, SELF, ix+1);
         }
         else if (ix < 0) {
-            ix += SELF->cache.int_val;
+            ix = SELF->cache.int_val;
         }
 
         if (src_key) src = src->vtable->get_pmc_keyed(INTERP, src, src_key);

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About