Changeset 2909 for proto


Ignore:
Timestamp:
Feb 13, 2013, 2:17:12 AM (7 years ago)
Author:
cameron
Message:

Nested while fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/CCGO.py

    r2801 r2909  
    6969        self.advIndex = {}
    7070        self.operation_offset = 0
     71        self.offset_stack = []
    7172        carry_counter = 0
    7273        adv_counter = 0
     
    149150    def EnterLocalWhileBlock(self, operation_offset): 
    150151        self.carryGroupVar = "sub" + self.carryGroupVar
     152        self.offset_stack = [self.operation_offset] + self.offset_stack
    151153        self.operation_offset = operation_offset
    152154    def ExitLocalWhileBlock(self): 
    153         self.operation_offset = 0
     155        self.operation_offset = self.offset_stack[0]
     156        self.offset_stack = self.offset_stack[1:]
    154157        self.carryGroupVar = self.carryGroupVar[3:]
    155158    def GenerateCarryWhileFinalization(self, block_no):
Note: See TracChangeset for help on using the changeset viewer.