Browse Source

Add explicit stack size limit in python turmit

Yann Weber 6 years ago
parent
commit
a7ff0da428
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      gte/turmit.py

+ 3
- 1
gte/turmit.py View File

@@ -42,6 +42,8 @@ class Turmit(object):
42 42
         #  @note This limit is handled by @ref rpnlib.RpnOp()
43 43
         self._signed_int = True
44 44
 
45
+        self._stack_max = 0xFFF
46
+
45 47
         if 'max_int' in kwargs:
46 48
             v = kwargs['max_int']
47 49
             if v < 1:
@@ -273,7 +275,7 @@ class Turmit(object):
273 275
         '''
274 276
 	    
275 277
         stksz = len(self._stack)
276
-        new_sz %= 0xFFF
278
+        new_sz %= self._stack_max
277 279
         if new_sz < 2:
278 280
             new_sz = 2
279 281
         if new_sz > stksz:

Loading…
Cancel
Save