]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
BUGFIX! Instructions are unsigned bytes.
authorGuido van Rossum <guido@python.org>
Tue, 16 Apr 1991 08:39:12 +0000 (08:39 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 16 Apr 1991 08:39:12 +0000 (08:39 +0000)
Python/compile.c

index 956719052c78c1911fd9c1896c1a894c7392cd70..59cdc0c13878e6fb55b27375531bb92537b8fa15 100644 (file)
@@ -1803,13 +1803,13 @@ static void
 optimizer(co)
        codeobject *co;
 {
-       char *next_instr, *cur_instr;
+       unsigned char *next_instr, *cur_instr;
        object *locals;
        int opcode;
        int oparg;
        object *name;
        int star_used;
-       
+
 #define NEXTOP()       (*next_instr++)
 #define NEXTARG()      (next_instr += 2, (next_instr[-1]<<8) + next_instr[-2])
 #define GETITEM(v, i)  (getlistitem((v), (i)))
@@ -1821,7 +1821,7 @@ optimizer(co)
                return; /* For now, this is OK */
        }
        
-       next_instr = GETSTRINGVALUE(co->co_code); 
+       next_instr = (unsigned char *) GETSTRINGVALUE(co->co_code); 
        for (;;) {
                opcode = NEXTOP();
                if (opcode == STOP_CODE)
@@ -1838,7 +1838,7 @@ optimizer(co)
        }
        
        star_used = (dictlookup(locals, "*") != NULL);
-       next_instr = GETSTRINGVALUE(co->co_code); 
+       next_instr = (unsigned char *) GETSTRINGVALUE(co->co_code); 
        for (;;) {
                cur_instr = next_instr;
                opcode = NEXTOP();