diff Python/compile.c @ 203:ceb36ec6198d legacy-trunk

BUGFIX! Instructions are unsigned bytes.
author Guido van Rossum <guido@python.org>
date Tue, 16 Apr 1991 08:39:12 +0000
parents 229168a2fe28
children 7e83115edb6a
line wrap: on
line diff
--- a/Python/compile.c	Tue Apr 16 08:38:43 1991 +0000
+++ b/Python/compile.c	Tue Apr 16 08:39:12 1991 +0000
@@ -1803,13 +1803,13 @@
 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 @@
 		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 @@
 	}
 	
 	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();