[FIX] safe_eval: allow STORE_FAST and DELETE_FAST opcodes, used e.g. for comprehension expressions

bzr revid: odo@openerp.com-20140428151133-uz7mphscch35dl6o
This commit is contained in:
Olivier Dony
2014-04-28 17:11:33 +02:00
parent 93ba7cc575
commit 4836354a16
+2 -1
View File
@@ -66,7 +66,8 @@ _SAFE_OPCODES = _EXPR_OPCODES.union(set(opmap[x] for x in [
'MAKE_FUNCTION', 'SLICE+0', 'SLICE+1', 'SLICE+2', 'SLICE+3',
# New in Python 2.7 - http://bugs.python.org/issue4715 :
'JUMP_IF_FALSE_OR_POP', 'JUMP_IF_TRUE_OR_POP', 'POP_JUMP_IF_FALSE',
'POP_JUMP_IF_TRUE', 'SETUP_EXCEPT', 'END_FINALLY', 'LOAD_FAST',
'POP_JUMP_IF_TRUE', 'SETUP_EXCEPT', 'END_FINALLY',
'LOAD_FAST', 'STORE_FAST', 'DELETE_FAST',
'LOAD_GLOBAL', # Only allows access to restricted globals
] if x in opmap))