@@ -26,7 +26,7 @@ def getNumSlots(argbits: int) -> int:
2626
2727 raise NotImplementedError
2828
29- def getRawParam (self , slot : int , argbits : int = None ) -> int :
29+ def getRawParam (self , slot : int , argbits : int = 0 ) -> int :
3030 """Read a value of native size from the specified argument slot.
3131
3232 Note that argument slots and argument indexes are not the same. Though they often correlate
@@ -41,7 +41,7 @@ def getRawParam(self, slot: int, argbits: int = None) -> int:
4141
4242 raise NotImplementedError
4343
44- def setRawParam (self , slot : int , value : int , argbits : int = None ) -> None :
44+ def setRawParam (self , slot : int , value : int , argbits : int = 0 ) -> None :
4545 """Replace the value in the specified argument slot.
4646
4747 Note that argument slots and argument indexes are not the same. Though they often correlate
@@ -148,17 +148,17 @@ def __access_param(self, index: int, stack_access: Callable, reg_access: Callabl
148148 else :
149149 return reg_access , reg
150150
151- def getRawParam (self , index : int , argbits : int = None ) -> int :
151+ def getRawParam (self , index : int , argbits : int = 0 ) -> int :
152152 read , loc = self .__access_param (index , self .arch .stack_read , self .arch .regs .read )
153153
154- mask = (0 if argbits is None else (1 << argbits )) - 1
154+ mask = (argbits and (1 << argbits )) - 1
155155
156156 return read (loc ) & mask
157157
158- def setRawParam (self , index : int , value : int , argbits : int = None ) -> None :
158+ def setRawParam (self , index : int , value : int , argbits : int = 0 ) -> None :
159159 write , loc = self .__access_param (index , self .arch .stack_write , self .arch .regs .write )
160160
161- mask = (0 if argbits is None else (1 << argbits )) - 1
161+ mask = (argbits and (1 << argbits )) - 1
162162
163163 write (loc , value & mask )
164164
0 commit comments