[Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pyassem.py,1.23,1.24

Jeremy Hylton jhylton@users.sourceforge.net
Wed, 29 Aug 2001 13:55:20 -0700


Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler
In directory usw-pr-cvs1:/tmp/cvs-serv8050

Modified Files:
	pyassem.py 
Log Message:
Fix off-by-one errors in code to find depth of stack.

XXX The code is still widely inaccurate, but most (all?) of the time
it's an overestimate.


Index: pyassem.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pyassem.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** pyassem.py	2001/08/29 19:45:33	1.23
--- pyassem.py	2001/08/29 20:55:17	1.24
***************
*** 765,773 ****
      # BUILD_LIST, CALL_FUNCTION, MAKE_FUNCTION, BUILD_SLICE
      def UNPACK_SEQUENCE(self, count):
!         return count
      def BUILD_TUPLE(self, count):
!         return -count
      def BUILD_LIST(self, count):
!         return -count
      def CALL_FUNCTION(self, argc):
          hi, lo = divmod(argc, 256)
--- 765,773 ----
      # BUILD_LIST, CALL_FUNCTION, MAKE_FUNCTION, BUILD_SLICE
      def UNPACK_SEQUENCE(self, count):
!         return count-1
      def BUILD_TUPLE(self, count):
!         return -count+1
      def BUILD_LIST(self, count):
!         return -count+1
      def CALL_FUNCTION(self, argc):
          hi, lo = divmod(argc, 256)