コード例 #1
0
def havoc_var(viper_ast: ViperAST, viper_type, ctx: Context):
    if ctx.is_pure_function:
        pure_idx = ctx.next_pure_var_index()
        function_result = viper_ast.Result(struct_type(viper_ast))
        return struct_get_idx(viper_ast, function_result, pure_idx, viper_type)
    else:
        havoc_name = ctx.new_local_var_name('havoc')
        havoc = viper_ast.LocalVarDecl(havoc_name, viper_type)
        ctx.new_local_vars.append(havoc)
        return havoc.localVar()
コード例 #2
0
def first_public_state_var(viper_ast: ViperAST, pos=None, info=None):
    return viper_ast.LocalVarDecl(mangled.FIRST_PUBLIC_STATE, viper_ast.Bool,
                                  pos, info)
コード例 #3
0
def overflow_var(viper_ast: ViperAST, pos=None, info=None):
    return viper_ast.LocalVarDecl(mangled.OVERFLOW, viper_ast.Bool, pos, info)
コード例 #4
0
def out_of_gas_var(viper_ast: ViperAST, pos=None, info=None):
    return viper_ast.LocalVarDecl(mangled.OUT_OF_GAS, viper_ast.Bool, pos,
                                  info)
コード例 #5
0
def msg_var(viper_ast: ViperAST, pos=None, info=None):
    return viper_ast.LocalVarDecl(mangled.MSG, viper_ast.Ref, pos, info)