<commit_before>#!/usr/bin/env python

import logging
l = logging.getLogger("simuvex.plugins.scratch")

import claripy

from .plugin import SimStatePlugin
class SimStateScratch(SimStatePlugin):
    def __init__(self, scratch=None):
        SimStatePlugin.__init__(self)

        # info on the current run
        self.bbl_addr = None
        self.stmt_idx = None
        self.ins_addr = None
        self.sim_procedure = None

        # information on exits *from* this state
        self.jumpkind = None
        self.guard = claripy.true
        self.target = None
        self.source = None
        self.exit_stmt_idx = None

        # information on VEX temps of this IRSB
        self.temps = { }

        # variable analysis of this block
        self.input_variables = SimVariableSet()
        self.used_variables = SimVariableSet()
        self.ignored_variables = None

        if scratch is not None:
            self.temps.update(scratch.temps)
            self.jumpkind = scratch.jumpkind
            self.guard = scratch.guard
            self.target = scratch.target
            self.source = scratch.source
            self.exit_stmt_idx = scratch.exit_stmt_idx

            self.input_variables |= scratch.input_variables
            self.used_variables |= scratch.used_variables
            self.ignored_variables = None if scratch.ignored_variables is None else scratch.ignored_variables.copy()

            self.bbl_addr = scratch.bbl_addr
            self.stmt_idx = scratch.stmt_idx
            self.ins_addr = scratch.ins_addr<commit_msg>A potential bug fix in SimStateScratch.<commit_after>#!/usr/bin/env python

import logging
l = logging.getLogger("simuvex.plugins.scratch")

import claripy

from .plugin import SimStatePlugin
class SimStateScratch(SimStatePlugin):
    def __init__(self, scratch=None):
        SimStatePlugin.__init__(self)

        # info on the current run
        self.bbl_addr = None
        self.stmt_idx = None
        self.ins_addr = None
        self.sim_procedure = None

        # information on exits *from* this state
        self.jumpkind = None
        self.guard = claripy.true
        self.target = None
        self.source = None
        self.exit_stmt_idx = None

        # information on VEX temps of this IRSB
        self.temps = { }

        # variable analysis of this block
        self.input_variables = SimVariableSet()
        self.used_variables = SimVariableSet()
        self.ignored_variables = None

        if scratch is not None:
            self.temps.update(scratch.temps)
            self.jumpkind = scratch.jumpkind
            self.guard = scratch.guard
            self.target = scratch.target
            self.source = scratch.source
            self.exit_stmt_idx = scratch.exit_stmt_idx

            if scratch.input_variables is not None:
                self.input_variables |= scratch.input_variables
            if scratch.used_variables is not None:
                self.used_variables |= scratch.used_variables
            self.ignored_variables = None if scratch.ignored_variables is None else scratch.ignored_variables.copy()

            self.bbl_addr = scratch.bbl_addr
            self.stmt_idx = scratch.stmt_idx
            self.ins_addr = scratch.ins_addr
{'fraction_non_alphanumeric': 0.07039655702428528, 'fraction_numerical': 0.0, 'mean_word_length': 2.162293488824101, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7218308', 'n_tokens_mistral': 910, 'n_tokens_neox': 879, 'n_words': 214}